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

Add trace_methods option #398

Merged
merged 5 commits into from
Jan 7, 2019
Merged

Conversation

felixbarny
Copy link
Member

@felixbarny felixbarny commented Dec 21, 2018

Defines a syntax for matching methods which should be traced

closes #347

Defines a syntax for matching methods which should be traced

closes elastic#347
@codecov-io
Copy link

codecov-io commented Dec 22, 2018

Codecov Report

Merging #398 into master will decrease coverage by 1.73%.
The diff coverage is 73.78%.

Impacted file tree graph

@@             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
Impacted Files Coverage Δ Complexity Δ
...tic/apm/agent/configuration/CoreConfiguration.java 95.52% <100%> (-1.26%) 16 <1> (-13)
...apm/agent/bci/bytebuddy/CustomElementMatchers.java 92.85% <100%> (-1.88%) 7 <1> (-2)
...ing/configuration/MethodMatcherValueConverter.java 40% <40%> (-20%) 1 <1> (-1)
...bci/methodmatching/TraceMethodInstrumentation.java 48.57% <48.57%> (ø) 8 <8> (ø) ⬇️
...java/co/elastic/apm/agent/bci/ElasticApmAgent.java 73.04% <70%> (-4.68%) 22 <3> (-7)
.../co/elastic/apm/agent/matcher/WildcardMatcher.java 95.19% <80%> (-2.28%) 30 <2> (-5)
...ic/apm/agent/bci/methodmatching/MethodMatcher.java 96.96% <96.96%> (-3.04%) 16 <16> (-1)
.../agent/plugin/api/AbstractSpanInstrumentation.java 53.19% <0%> (-10.45%) 3% <0%> (-4%)
.../co/elastic/apm/agent/impl/error/ErrorCapture.java 79.62% <0%> (-7.28%) 20% <0%> (-15%)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 035ba3a...ce8f1d2. Read the comment docs.

@felixbarny felixbarny self-assigned this Dec 22, 2018
Copy link
Contributor

@eyalkoren eyalkoren left a 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(*, *, *)")));
Copy link
Member Author

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.

Add test cases to TraceMethodInstrumentationTest
@felixbarny felixbarny merged commit f1611f9 into elastic:master Jan 7, 2019
@felixbarny felixbarny deleted the trace-methods branch January 7, 2019 15:27
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.

Add a config to enable tracing of specific methods
4 participants