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

Return span context ref #325

Merged
merged 3 commits into from
Nov 1, 2020
Merged

Return span context ref #325

merged 3 commits into from
Nov 1, 2020

Conversation

jtescher
Copy link
Member

@jtescher jtescher commented Nov 1, 2020

Currently the Span trait in the API has its span_context method return an owned SpanContext. In order to be more consistent with the rest of the APIs, this patch updates the trait to instead return a reference, and moves the SpanContext data outside of the mutex in the SDK to implement the trait. This also allows #265 to be implemented
without having to lock.

Additionally the spec now states that the on_start method for SpanProcessors must be passed a span and the parent context so those are updated as well.

Currently the `Span` trait in the API has its `span_context` method
return an owned `SpanContext`. In order to be more consistent with the
rest of the APIs, this patch updates the trait to instead return a
reference, and moves the `SpanContext` data outside of the mutex in the
SDK to implement the trait. This also allows #265 to be implemented
without having to lock.

Additionally the spec now states that the `on_start` method for
`SpanProcessor`s must be passed a span and the parent context so those
are updated as well.
@jtescher jtescher requested a review from a team November 1, 2020 21:06
@codecov
Copy link

codecov bot commented Nov 1, 2020

Codecov Report

Merging #325 into master will decrease coverage by 0.04%.
The diff coverage is 64.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #325      +/-   ##
==========================================
- Coverage   53.42%   53.37%   -0.05%     
==========================================
  Files          71       71              
  Lines        5758     5778      +20     
==========================================
+ Hits         3076     3084       +8     
- Misses       2682     2694      +12     
Impacted Files Coverage Δ
opentelemetry/src/api/trace/context.rs 94.44% <ø> (ø)
opentelemetry/src/api/trace/span.rs 64.51% <ø> (ø)
opentelemetry/src/api/trace/tracer.rs 39.47% <ø> (ø)
opentelemetry/src/sdk/trace/span_processor.rs 69.23% <0.00%> (ø)
opentelemetry/src/sdk/trace/span.rs 73.10% <54.34%> (-3.61%) ⬇️
opentelemetry/src/sdk/trace/tracer.rs 75.16% <72.00%> (+0.32%) ⬆️
opentelemetry/src/api/trace/noop.rs 66.01% <100.00%> (+1.01%) ⬆️
opentelemetry/src/global/trace.rs 60.00% <100.00%> (ø)
opentelemetry/src/sdk/propagation/aws.rs 92.10% <100.00%> (ø)
opentelemetry/src/testing/trace.rs 23.07% <100.00%> (ø)
... and 1 more

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 88ee281...955fce0. Read the comment docs.

Copy link
Contributor

@TommyCpp TommyCpp left a comment

Choose a reason for hiding this comment

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

Looks nice! 👍

@jtescher jtescher merged commit 8b2fbba into master Nov 1, 2020
@jtescher jtescher deleted the span-context-ref branch November 1, 2020 23:22
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.

2 participants