-
Notifications
You must be signed in to change notification settings - Fork 144
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
Class annotation to trace lambda methods #274
Conversation
Assert.assertEquals(metricName, traceAnnotation.getValue().metricName()); | ||
} | ||
} | ||
|
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.
In my local testing, I tried a poorly named method called notlambda$doingWork$1()
. It's plain method, no lambdas.
As expected, this did not match 😄 Would there be value in a test that we don't match on just lambda
?
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.
Hi Xi,
The default behaviour is to run the following regex "^\$?(lambda|anonfun)\$(?.*)" against the names of all the static methods in the marked class. Only static methods with names matching the pattern will match. The default pattern aims to cover Java and Scala lambda expressions as they are compiled to static methods.
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.
@GDownes LGTM! I had one curiosity regarding the tests and I provided a comment for it.
Running AITs internally, hold please |
Internal AITs look good, merging - https://javaagent-build.pdx.vm.datanerd.us/job/JavaAgent_PR_AIT/68/ |
Overview
New class annotation TraceLambda. Marking a class with the TraceLambda annotation will instruct the New Relic agent to automatically annotate lambda methods within the marked class with a Trace annotation.
Testing
Added unit tests to cover TraceLambda usage scenarios.
Deploy updated agent locally and reviewed traces in New Relic One.
Checks
[x] Are your contributions backwards compatible with relevant frameworks and APIs? Yes
[x] Does your code contain any breaking changes? Please describe. No
[x] Does your code introduce any new dependencies? Please describe. No