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

Store current Span instead of local and remote SpanContext in context.Context #1731

Merged
merged 8 commits into from
Mar 29, 2021

Conversation

MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Mar 25, 2021

Now that the SpanContext has a remote identifier, storing a Span's SpanContext two separate ways in a Context (one for local another for remote) is unnecessary and adds complication throughout the project when determining heredity of a Span. This moves to storing the Span directly in the Context uniformly (for both local and remote) as current Span. In the process, it updates the getter/setter functionality in the trace package provides and removes the distributed heredity logic throughout the project with just using the current Span as the parent if it exists.

Resolves #1182

Now that the SpanContext has a remote identifier, storing a Span's
SpanContext two separate ways in a Context (one for local another for
remote) is unnecessary and adds complication throughout the project when
determining heredity of a Span. This moves to storing the Span directly
in the Context uniformly (for both local and remote) as current Span. In
the process, it updates the getter/setter functionality the `trace`
package provides and replaces the distributed heredity logic throughout
the project with just using the current Span as the parent if it exists.
@codecov
Copy link

codecov bot commented Mar 25, 2021

Codecov Report

Merging #1731 (03c3bbe) into main (c61f4b6) will increase coverage by 0.0%.
The diff coverage is 93.3%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #1731   +/-   ##
=====================================
  Coverage   77.9%   78.0%           
=====================================
  Files        131     132    +1     
  Lines       6953    6941   -12     
=====================================
- Hits        5422    5417    -5     
+ Misses      1281    1274    -7     
  Partials     250     250           
Impacted Files Coverage Δ
bridge/opentracing/bridge.go 47.8% <0.0%> (ø)
trace/noop.go 57.1% <ø> (ø)
trace/trace.go 86.4% <ø> (+0.2%) ⬆️
bridge/opentracing/internal/mock.go 73.6% <100.0%> (ø)
oteltest/config.go 92.1% <100.0%> (-0.4%) ⬇️
oteltest/tracer.go 89.6% <100.0%> (-1.0%) ⬇️
sdk/trace/span.go 90.4% <100.0%> (ø)
trace/context.go 100.0% <100.0%> (ø)
trace/nonrecording.go 100.0% <100.0%> (ø)
... and 2 more

propagation/propagators_test.go Show resolved Hide resolved
trace/context.go Outdated Show resolved Hide resolved
@MrAlias MrAlias requested a review from paivagustavo as a code owner March 28, 2021 15:39
@MrAlias MrAlias merged commit 604b05c into open-telemetry:main Mar 29, 2021
@MrAlias MrAlias deleted the rm-remote-ctx-keys branch March 29, 2021 15:55
@MrAlias MrAlias mentioned this pull request Apr 23, 2021
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.

Reconsider the context keys
3 participants