-
Notifications
You must be signed in to change notification settings - Fork 324
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
migrate to indy apm-error-logging-plugin #1362
migrate to indy apm-error-logging-plugin #1362
Conversation
return Boolean.FALSE; | ||
} | ||
}; | ||
public static final GlobalThreadLocal<Boolean> nestedThreadLocal = GlobalThreadLocal.get(AbstractLoggerErrorCapturingInstrumentation.class, "nested", Boolean.FALSE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be simplified with co.elastic.apm.agent.sdk.state.CallDepth
. See co.elastic.apm.agent.servlet.RequestStreamRecordingInstrumentation.GetInputStreamAdvice
as an example.
When using it, make sure to add onThrowable = Throwable.class
to OnMethodExit
. See also the Javadocs of co.elastic.apm.agent.sdk.state.CallDepth#decrement
for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced with CallDepth
if (callDepth.isNestedCallAndDecrement()) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be simplified as there's already a if (errorCaptureObj instanceof ErrorCapture)
check afterwards. That check is only true if the error object is not null.
if (callDepth.isNestedCallAndDecrement()) { | |
return; | |
} | |
callDepth.decrement(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simplified
refer #1337