-
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
Add trace_methods option #398
Conversation
Defines a syntax for matching methods which should be traced closes elastic#347
Codecov Report
@@ Coverage Diff @@
## master #398 +/- ##
============================================
- Coverage 74.19% 72.46% -1.74%
+ Complexity 1429 1315 -114
============================================
Files 144 143 -1
Lines 5805 5048 -757
Branches 692 517 -175
============================================
- Hits 4307 3658 -649
+ Misses 1269 1154 -115
- Partials 229 236 +7
Continue to review full report at Codecov.
|
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.
Beautiful and extremely powerful!!
Just enhance the instrumentation test to test modifiers and arguments matching as well
"NOTE: Only use wildcards if necessary.\n" + | ||
"The more methods you match to more overhead will be caused by the agent.\n" + | ||
"Also note that there is a maximum amount of spans per transaction (see <<config-transaction-max-spans, `transaction_max_spans`>>).") | ||
.buildWithDefault(Collections.singletonList(MethodMatcher.of("org.springframework.web.servlet.DispatcherServlet#render(*, *, *)"))); |
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.
Remove default, that was just for testing purposes. When actually instrumenting DispatcherServlet#render
, we probably want to set a custom type. Maybe template or render.
.../src/test/java/co/elastic/apm/agent/bci/methodmatching/MethodMatcherInstrumentationTest.java
Show resolved
Hide resolved
.../src/test/java/co/elastic/apm/agent/bci/methodmatching/MethodMatcherInstrumentationTest.java
Show resolved
Hide resolved
Add test cases to TraceMethodInstrumentationTest
Defines a syntax for matching methods which should be traced
closes #347