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

Fix parent based sampling in tracer #354

Merged
merged 3 commits into from Nov 9, 2020
Merged

Fix parent based sampling in tracer #354

merged 3 commits into from Nov 9, 2020

Conversation

jtescher
Copy link
Member

@jtescher jtescher commented Nov 9, 2020

Currently the sdk Tracer implementation will filter out invalid / dropped parent span contexts. This causes the parent based sampler to not function properly as it will then assume that child spans are roots.

This patch resolves this issue by adding a has_active_span method to the trace context extension, which allows the tracer to distinguish between invalid and unset parent contexts.

Fixes #351

Currently the sdk `Tracer` implementation will filter out invalid /
dropped parent span contexts. This causes the parent based sampler to
not function properly as it will then assume that child spans are roots.

This patch resolves this issue by adding a `has_active_span` method to
the trace context extension, which allows the tracer to distinguish
between invalid and unset parent contexts.
@jtescher jtescher requested a review from a team as a code owner November 9, 2020 19:08
@codecov
Copy link

codecov bot commented Nov 9, 2020

Codecov Report

Merging #354 (88ddf96) into master (bd69642) will increase coverage by 0.15%.
The diff coverage is 96.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #354      +/-   ##
==========================================
+ Coverage   54.03%   54.19%   +0.15%     
==========================================
  Files          70       70              
  Lines        5833     5849      +16     
==========================================
+ Hits         3152     3170      +18     
+ Misses       2681     2679       -2     
Impacted Files Coverage Δ
opentelemetry/src/api/trace/span_context.rs 75.79% <ø> (ø)
opentelemetry/src/sdk/metrics/aggregators/array.rs 0.00% <0.00%> (ø)
opentelemetry/src/api/trace/context.rs 95.23% <100.00%> (+0.79%) ⬆️
opentelemetry/src/api/trace/noop.rs 68.26% <100.00%> (ø)
...ntelemetry/src/sdk/metrics/aggregators/ddsketch.rs 78.28% <100.00%> (-0.20%) ⬇️
opentelemetry/src/sdk/trace/tracer.rs 78.31% <100.00%> (+3.80%) ⬆️

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 bd69642...88ddf96. Read the comment docs.

@jtescher jtescher merged commit 9aec85b into master Nov 9, 2020
@jtescher jtescher deleted the parent-based-bug branch November 9, 2020 21:50
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.

Sampler::TraceIdRatioBased problem
2 participants