Skip to content

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

Merged
MrAlias merged 8 commits intoopen-telemetry:mainfrom
MrAlias:rm-remote-ctx-keys
Mar 29, 2021
Merged

Store current Span instead of local and remote SpanContext in context.Context#1731
MrAlias merged 8 commits intoopen-telemetry:mainfrom
MrAlias:rm-remote-ctx-keys

Conversation

@MrAlias
Copy link
Copy Markdown
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
Copy Markdown

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

Comment thread propagation/propagators_test.go
Comment thread trace/context.go Outdated
@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