Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support parameterized exception messages #1043

Closed
wolframhaussig opened this issue Feb 17, 2020 · 2 comments
Closed

Support parameterized exception messages #1043

wolframhaussig opened this issue Feb 17, 2020 · 2 comments

Comments

@wolframhaussig
Copy link
Contributor

wolframhaussig commented Feb 17, 2020

Is your feature request related to a problem?

We are using APM for a while now and it is a great tool for finding bugs and performance problems but in a few of our applications we have an explotion of error groups in the APM UI. An example:
One of those applications basically executes job chains. If an exception is thrown the exception message is used as the error message of this job. If a required dependency is still running the exception message is something like this:

Pending data jobs detected: Object '123' has data job 'MY_JOB_TYPE' (ID='10000001') with state 'INITIATED'.

Basically, we get a new error group in the Kibana Error UI for each JOB_ID which was not yet completed at the time the successor started.

Describe the solution you'd like

While I still want the complete error message in the transactions UI I want all of those errors grouped when looking in the Error UI of APM.

Describe alternatives you've considered

One workaround would be to use #853 once implemented to change the error details manually.

A workaround would be to change the error message to a general error text and add the real error message as a custom label but as the node.js agent already supports something similar I think this should be added to the Java agent.

Additional context

There are 2 parts which are affected:

  1. the manual capturing of exceptions
  2. the automatic instrumentation

I don't know if this aligns to your concept but i think of something like this:
In the API provide an interface like this:

package co.elastic.apm.api;

public interface ParameterizedMessage {
    String getMessage();
    String getMessageTemplate();
}

When capturing an exception(manual or automatic) the agent checks if the Exception implements this interface. If true, store the message template (additionally to the normal message) in param_message.

If the error grouping is working for someone they do not need to change anything. If it is not working (like for us) we implement the interface so the agent knows both the message template and the interpolated text.

@felixbarny
Copy link
Member

Hm, the exception message should not have an effect on the error group. That's precisely because the error message can be dynamic. I have just tested this out and can confirm it's still working.

The APM Server basically calculates a hash of the stack trace, without the line numbers (as they would likely vary in different versions).

Could you maybe share the documents in question?

@wolframhaussig
Copy link
Contributor Author

Hey Felix, thanks a lot for the hint: I was looking at the wrong place as the stacktraces are different....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants