Skip to content

Conversation

@SylvainJuge
Copy link
Member

@SylvainJuge SylvainJuge commented Mar 25, 2020

What does this PR do?

This PR tests and improve heuristics to get service name from JVM system properties.
Current implementation might allow to have empty values and did not handled properly values with spaces.

Checklist

  • My code follows the style guidelines of this project
  • I have rebased my changes on top of the latest master branch
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated CHANGELOG.asciidoc
  • I have updated supported-technologies.asciidoc
  • Added an API method or config option? Document in which version this will be introduced
  • Added an instrumentation plugin? How did you make sure that old, non-supported versions are not instrumented by accident?

Author's Checklist

  • manual testing with Weblogic server
if (commandPart.endsWith(".jar")) {
return removeVersionFromJar(removePath(removeJarExtension(commandPart)));
result = removeVersionFromJar(removePath(removeJarExtension(commandPart)));
break;
Copy link
Member Author

@SylvainJuge SylvainJuge Mar 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using a break here allows to maximize coverage, otherwise the return null; statement was dead code

@SylvainJuge SylvainJuge marked this pull request as ready for review March 25, 2020 17:17
@codecov-io
Copy link

Codecov Report

Merging #1097 into master will increase coverage by 1.18%.
The diff coverage is 100.00%.

Impacted file tree graph

@@ Coverage Diff @@ ## master #1097 +/- ## ============================================ + Coverage 58.82% 60.00% +1.18%  Complexity 87 87 ============================================ Files 334 327 -7 Lines 15539 14768 -771 Branches 2209 2059 -150 ============================================ - Hits 9141 8862 -279  + Misses 5778 5308 -470  + Partials 620 598 -22 
Impacted Files Coverage Δ Complexity Δ
...astic/apm/agent/configuration/ServiceNameUtil.java 95.83% <100.00%> (+18.56%) 0.00 <0.00> (ø)
...stic/apm/agent/jdbc/ConnectionInstrumentation.java 60.00% <0.00%> (-12.73%) 0.00% <0.00%> (ø%)
...astic/apm/agent/jdbc/StatementInstrumentation.java 26.61% <0.00%> (-12.06%) 0.00% <0.00%> (ø%)
...m/agent/servlet/ServletVersionInstrumentation.java 29.78% <0.00%> (-3.55%) 0.00% <0.00%> (ø%)
...astic/apm/agent/bci/ElasticApmInstrumentation.java 58.82% <0.00%> (-2.29%) 0.00% <0.00%> (ø%)
...java/co/elastic/apm/agent/bci/ElasticApmAgent.java 73.38% <0.00%> (-2.17%) 0.00% <0.00%> (ø%)
...o/elastic/apm/agent/profiler/SamplingProfiler.java 77.93% <0.00%> (-0.84%) 0.00% <0.00%> (ø%)
...co/elastic/apm/agent/jdbc/JdbcInstrumentation.java 100.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...tic/apm/agent/servlet/helper/ApmAsyncListener.java 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
.../agent/servlet/AbstractServletInstrumentation.java 100.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
... and 19 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 f19f290...5e4445d. Read the comment docs.

@SylvainJuge SylvainJuge merged commit 4319f99 into elastic:master Mar 26, 2020
@SylvainJuge SylvainJuge deleted the empty-or-null-service_name branch March 26, 2020 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants