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 http url to span context #218

Merged
merged 3 commits into from
Sep 21, 2018

Conversation

eyalkoren
Copy link
Contributor

@eyalkoren eyalkoren commented Sep 20, 2018

No description provided.

@eyalkoren
Copy link
Contributor Author

#174

@codecov-io
Copy link

codecov-io commented Sep 20, 2018

Codecov Report

Merging #218 into master will increase coverage by 0.13%.
The diff coverage is 62.5%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #218      +/-   ##
============================================
+ Coverage     73.52%   73.66%   +0.13%     
- Complexity     1112     1125      +13     
============================================
  Files           117      118       +1     
  Lines          4193     4218      +25     
  Branches        412      416       +4     
============================================
+ Hits           3083     3107      +24     
- Misses          911      912       +1     
  Partials        199      199
Impacted Files Coverage Δ Complexity Δ
...esttemplate/SpringRestTemplateInstrumentation.java 40.9% <0%> (-1.95%) 4 <0> (ø)
...pm/httpclient/ApacheHttpClientInstrumentation.java 46.15% <0%> (ø) 4 <0> (ø) ⬇️
...a/co/elastic/apm/http/client/HttpClientHelper.java 0% <0%> (ø) 0 <0> (ø) ⬇️
.../java/co/elastic/apm/impl/context/SpanContext.java 100% <100%> (ø) 8 <5> (+2) ⬆️
...ain/java/co/elastic/apm/impl/transaction/Http.java 77.77% <77.77%> (ø) 6 <6> (?)
...lastic/apm/report/serialize/DslJsonSerializer.java 87.24% <81.81%> (+0.2%) 120 <1> (+3) ⬆️
...stic/apm/report/IntakeV1ReportingEventHandler.java 75.55% <0%> (+2.22%) 12% <0%> (ø) ⬇️
.../co/elastic/apm/impl/transaction/AbstractSpan.java 74.24% <0%> (+3.03%) 22% <0%> (+1%) ⬆️
... and 1 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 d8b583f...035f006. Read the comment docs.

@@ -56,7 +56,7 @@ private static void onBeforeExecute(@Advice.Argument(0) HttpRoute route,
return;
}
final AbstractSpan<?> parent = tracer.getActive();
span = HttpClientHelper.startHttpClientSpan(parent, request.getMethod(), route.getTargetHost().getHostName(), SPAN_TYPE_APACHE_HTTP_CLIENT);
span = HttpClientHelper.startHttpClientSpan(parent, request.getMethod(), String.valueOf(request.getURI()), route.getTargetHost().getHostName(), SPAN_TYPE_APACHE_HTTP_CLIENT);
Copy link
Member

Choose a reason for hiding this comment

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

why do you use String.valueOf here? Can the URI return null? In that case, it might be better to change the signature of startHttpClientSpan to @Nullable URI or @Nullable String and only set if not null.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to HttpRequestWrapper's constructor it can be set to null. You're right, better not to set a null string.

Copy link
Member

@felixbarny felixbarny left a comment

Choose a reason for hiding this comment

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

only a minor comment and some non-formatted lines, otherwise LGTM

@eyalkoren eyalkoren merged commit a4b4fcb into elastic:master Sep 21, 2018
@eyalkoren eyalkoren deleted the add-http-url-to-span-context branch September 21, 2018 06:20
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.

3 participants