Include advice class name in instrumentation exception handler log#11457
Open
amarziali wants to merge 2 commits into
Open
Include advice class name in instrumentation exception handler log#11457amarziali wants to merge 2 commits into
amarziali wants to merge 2 commits into
Conversation
Contributor
|
Contributor
Author
|
Depends somehow on #11268 that will fix the exception that's excluded in system tests but now the text slightly changed :) |
mhlidd
reviewed
May 26, 2026
Contributor
mhlidd
left a comment
There was a problem hiding this comment.
Code looks good. Just some nit comments for clarity since I got confused following 😅
Co-authored-by: mhlidd <matthew.li@datadoghq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
Refactors
ExceptionHandlers.defaultExceptionHandlerinto a factory that takes the advice class FQN, and changes the bytecode it emits so the resulting log line is:instead of:
The existing
... for <instrumentedClass>prefix is preserved (so existing log searches / dashboards keep working);Please note that now the stack manipulation is compound and made of two part:
TextConstantthat's allocated for each Advice when they are installed (it's small and cheap, just doing aLDC)The new logging bytecode has been adapted to consume the advice name from the stack and weave it into the log message at runtime via two
String.concatcalls.This is very useful to understand which advice specifically triggered the error for the telemetry. Unfortunately there is no easy way to make distinction between the
OnMethodEnter/OnMethodExitbut this is a nice step forward in improving the message.Motivation
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issue/merge. You can also:/merge --commit-message "..."/merge -c/merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-levelJira ticket: [PROJ-IDENT]