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

Use a consistent key for the current span in the context #480

Merged
merged 4 commits into from
Dec 23, 2020

Conversation

pyohannes
Copy link
Contributor

The Extract call on the W3C propagator used to store the extracted span under the key current-span in the context, whereas on other places we rely on the current span being stored under the key span_key. This discrepancy will break context propagation.

This PR unifies this to use a constant kSpanKey in all relevant places and also adds tests.

@pyohannes pyohannes requested a review from a team December 22, 2020 19:24
@pyohannes pyohannes linked an issue Dec 22, 2020 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Dec 22, 2020

Codecov Report

Merging #480 (3e4e3c3) into master (ab7a8a2) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #480      +/-   ##
==========================================
- Coverage   94.43%   94.37%   -0.06%     
==========================================
  Files         187      189       +2     
  Lines        8244     8410     +166     
==========================================
+ Hits         7785     7937     +152     
- Misses        459      473      +14     
Impacted Files Coverage Δ
api/include/opentelemetry/trace/span.h 100.00% <ø> (ø)
...entelemetry/trace/propagation/http_trace_context.h 86.79% <100.00%> (ø)
api/include/opentelemetry/trace/scope.h 100.00% <100.00%> (ø)
api/include/opentelemetry/trace/tracer.h 100.00% <100.00%> (ø)
...pi/test/trace/propagation/http_text_format_test.cc 98.30% <100.00%> (ø)
api/test/trace/scope_test.cc 100.00% <100.00%> (ø)
sdk/src/trace/tracer.cc 73.52% <100.00%> (ø)
api/include/opentelemetry/nostd/string_view.h 97.56% <0.00%> (+0.06%) ⬆️
... and 1 more

@pyohannes pyohannes added the pr:please-merge This PR is ready to be merged by a Maintainer (rebased, CI passed, has enough valid approvals, etc.) label Dec 22, 2020
Co-authored-by: Tom Tan <lilotom@gmail.com>
@lalitb lalitb merged commit 2c97611 into open-telemetry:master Dec 23, 2020
kxyr pushed a commit to open-o11y/opentelemetry-cpp that referenced this pull request Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:please-merge This PR is ready to be merged by a Maintainer (rebased, CI passed, has enough valid approvals, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

W3C TraceContext compliance
5 participants