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

migrate to indy apm-error-logging-plugin #1362

Conversation

videnkz
Copy link
Contributor

@videnkz videnkz commented Aug 30, 2020

refer #1337

@apmmachine
Copy link
Contributor

apmmachine commented Aug 30, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Branch indexing]

  • Start Time: 2020-09-13T11:39:20.555+0000

  • Duration: 47 min 15 sec

Test stats 🧪

Test Results
Failed 0
Passed 1484
Skipped 11
Total 1495

@felixbarny felixbarny mentioned this pull request Aug 31, 2020
37 tasks
return Boolean.FALSE;
}
};
public static final GlobalThreadLocal<Boolean> nestedThreadLocal = GlobalThreadLocal.get(AbstractLoggerErrorCapturingInstrumentation.class, "nested", Boolean.FALSE);
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaced with CallDepth

@videnkz videnkz requested a review from felixbarny August 31, 2020 10:49
Comment on lines 70 to 72
if (callDepth.isNestedCallAndDecrement()) {
return;
}
Copy link
Member

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.

Suggested change
if (callDepth.isNestedCallAndDecrement()) {
return;
}
callDepth.decrement();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simplified

@videnkz videnkz requested a review from felixbarny August 31, 2020 11:44
@SylvainJuge SylvainJuge merged commit 554d5cb into elastic:master Sep 14, 2020
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

Successfully merging this pull request may close these issues.

4 participants