Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

[apache] [jax-rs2] Instrumentation specific multiple span reporting Issue #297

Merged

Conversation

dray92
Copy link
Contributor

@dray92 dray92 commented Nov 29, 2017

  • Apache span interceptors have lighter dependency on threadlocal; newly created span is not pushed
  • HttpContext is used to propagate the span between interceptors
  • Similar changes in jax-rs2 instrumentation to reduce dependence on thread local, and instead use jax-rs2 specific javax.ws.rs.client.ClientRequestContext

Per #295

@@ -147,6 +148,10 @@ public SpanContext context() {

@Override
public void finish() {
if (finished) {
Copy link
Member

Choose a reason for hiding this comment

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

this logic should be in the finishWithDuration method, and inside the synchronized block

@codecov
Copy link

codecov bot commented Nov 29, 2017

Codecov Report

Merging #297 into master will increase coverage by 0.09%.
The diff coverage is 75%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master    #297      +/-   ##
===========================================
+ Coverage        83%   83.1%   +0.09%     
- Complexity      551     553       +2     
===========================================
  Files            91      91              
  Lines          2165    2160       -5     
  Branches        244     244              
===========================================
- Hits           1797    1795       -2     
+ Misses          267     266       -1     
+ Partials        101      99       -2
Impacted Files Coverage Δ Complexity Δ
...aeger/filters/jaxrs2/ClientSpanCreationFilter.java 100% <ø> (ø) 4 <0> (ø) ⬇️
...ger/httpclient/SpanCreationRequestInterceptor.java 83.33% <ø> (-0.67%) 5 <0> (ø)
...a/com/uber/jaeger/filters/jaxrs2/ClientFilter.java 100% <100%> (+13.33%) 4 <0> (ø) ⬇️
...er/httpclient/SpanInjectionRequestInterceptor.java 75% <100%> (-1.93%) 3 <1> (ø)
...r/jaeger/httpclient/TracingRequestInterceptor.java 78.57% <100%> (-1.43%) 4 <1> (ø)
...eger/filters/jaxrs2/ClientSpanInjectionFilter.java 73.68% <50%> (-9.65%) 4 <2> (ø)
...jaeger/reporters/protocols/ThriftUdpTransport.java 86.44% <0%> (+5.08%) 16% <0%> (+2%) ⬆️

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 9c6d3a5...4e58e60. Read the comment docs.

@vprithvi
Copy link
Contributor

Could you split this into two separate PRs by separating the instrumentation fixes from the changes in the Span class?

@dray92
Copy link
Contributor Author

dray92 commented Nov 29, 2017

@vprithvi definitely -- lemme just remove the span class changes

@dray92 dray92 force-pushed the bugfix_multiple_span_finish branch from 2b01739 to 41a0f4e Compare November 29, 2017 04:29
@dray92 dray92 changed the title [jaeger-client-java] #295 Multiple Span reporting issue [jaeger-client-java] [apache] [jax-rs2] Instrumentation specific multiple span reporting Issue Nov 29, 2017
…s depend on thread local, and instead on the implementation specific http context propagation mechanisms

Signed-off-by: Debosmit Ray <debo@uber.com>
@dray92 dray92 force-pushed the bugfix_multiple_span_finish branch from 41a0f4e to 4e58e60 Compare November 29, 2017 04:43
@yurishkuro yurishkuro changed the title [jaeger-client-java] [apache] [jax-rs2] Instrumentation specific multiple span reporting Issue [apache] [jax-rs2] Instrumentation specific multiple span reporting Issue Nov 30, 2017
@@ -124,7 +130,7 @@ public void testHttpClientTracing() throws Exception {
private void verifyTracing(Span parentSpan) {
//Assert that traces are correctly emitted by the client
List<Span> spans = reporter.getSpans();
assertEquals(3, spans.size());
assertEquals(2, spans.size());
Copy link
Member

Choose a reason for hiding this comment

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

what is the reason for this change?

Copy link
Contributor Author

@dray92 dray92 Nov 30, 2017

Choose a reason for hiding this comment

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

Previously, when pop() was getting called, it would make another call to report the span. Hence the reporter was getting an extra span, and the last 2 spans were identical. This change proves that the core issue is fixed.

@yurishkuro yurishkuro merged commit 7250579 into jaegertracing:master Dec 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants