Skip to content

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

Merged
SylvainJuge merged 3 commits intoelastic:masterfrom
videnkz:issue-1337-migrate-to-indy-apm-error-logging-plugin
Sep 14, 2020
Merged

migrate to indy apm-error-logging-plugin#1362
SylvainJuge merged 3 commits intoelastic:masterfrom
videnkz:issue-1337-migrate-to-indy-apm-error-logging-plugin

Conversation

@videnkz
Copy link
Contributor

@videnkz videnkz commented Aug 30, 2020

refer #1337

@ghost
Copy link

ghost 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

3 participants