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

Implement the text format so that w3c trace context headers are propagated. #601

Conversation

jkwatson
Copy link
Contributor

No description provided.

@codecov-io
Copy link

Codecov Report

Merging #601 into master will increase coverage by 0.41%.
The diff coverage is 95.23%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master    #601      +/-   ##
===========================================
+ Coverage     78.28%   78.7%   +0.41%     
- Complexity      694     707      +13     
===========================================
  Files            86      87       +1     
  Lines          2459    2479      +20     
  Branches        233     236       +3     
===========================================
+ Hits           1925    1951      +26     
+ Misses          445     441       -4     
+ Partials         89      87       -2
Impacted Files Coverage Δ Complexity Δ
...stributedcontext/DistributedContextManagerSdk.java 66.66% <0%> (ø) 4 <0> (ø) ⬇️
...butedcontext/DistributedContextHttpTextFormat.java 100% <100%> (ø) 10 <10> (?)
...ntelemetry/sdk/trace/RecordEventsReadableSpan.java 95.93% <0%> (+1.16%) 55% <0%> (+1%) ⬆️
.../sdk/distributedcontext/DistributedContextSdk.java 91.83% <0%> (+2.04%) 15% <0%> (+1%) ⬆️
...elemetry/sdk/trace/export/BatchSpansProcessor.java 95.74% <0%> (+2.12%) 9% <0%> (ø) ⬇️
...ry/distributedcontext/EmptyDistributedContext.java 100% <0%> (+20%) 4% <0%> (+1%) ⬆️

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 f15bb4a...a8cf55f. Read the comment docs.

static final String TRACEPARENT = "traceparent";
static final String TRACESTATE = "tracestate";
private static final List<String> FIELDS =
Collections.unmodifiableList(Arrays.asList(TRACEPARENT, TRACESTATE));
Copy link
Member

Choose a reason for hiding this comment

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

I think this is the correlation-context from the w3c.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there something you think should be renamed in here?

@arminru
Copy link
Member

arminru commented Oct 11, 2019

Hi John!

W3C Trace Context (text format) is already implemented here:
https://github.com/open-telemetry/opentelemetry-java/blob/master/api/src/main/java/io/opentelemetry/trace/propagation/HttpTraceContext.java

The DistributedContext you're trying to implement is a compound of the W3C Correlation Context (currently being drafted here) on the one hand and what is commonly referred to as "Baggage" on the other hand, but not the W3C Trace Context (unless I'm mixing things up myself here).
There's a proposal to properly split DistributedContext into Correlation Context and Baggage being discussed here: open-telemetry/oteps#42. It might be better to wait for this to be settled.

See also:

@jkwatson
Copy link
Contributor Author

Sorry, the title of the PR is probably a little misleading. The purpose here was to at least propagate the trace context headers, so traces aren't broken. With the current implementation (that just throws UnsupportedOperationExceptions), traces are broken when requests flow through the tracers.

I'm happy to update any and all verbiage as appropriate, or simply have the methods return empty contexts and not inject anything (still resulting in broken traces, but at least not throwing exceptions).

@jkwatson jkwatson changed the title Implement the text format for w3c trace context. Implement the text format so that w3c trace context headers are propagated. Oct 11, 2019
@jkwatson
Copy link
Contributor Author

I was confused about where the headers needed to be propagated. This is actually fixed for real in #608 . closing!

@jkwatson jkwatson closed this Oct 11, 2019
@jkwatson jkwatson deleted the implement_distributed_context_text_format branch October 11, 2019 22:29
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.

4 participants