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

Associate valid SpanId/SpanContext with Spans irrespective of the Sampling decision. #879

Merged
merged 6 commits into from
Jul 1, 2021

Conversation

lalitb
Copy link
Member

@lalitb lalitb commented Jun 29, 2021

Fixes #878

Changes

As per Specs, non-sampled / dropped spans should still have the valid SpanId. The child span of the non-sampled span should have the same trace_id associated.

Generate a new span ID for the Span, independently of the sampling decision. This is done so other components (such as logs or exception handling) can rely on a unique span ID, even if the Span is a non-recording instance.

This PR ensures that a valid span-id is associated with the non-sampled spans.

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@lalitb lalitb requested a review from a team June 29, 2021 08:19
@codecov
Copy link

codecov bot commented Jun 29, 2021

Codecov Report

Merging #879 (fc7247c) into main (8556485) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #879      +/-   ##
==========================================
+ Coverage   95.44%   95.45%   +0.02%     
==========================================
  Files         157      157              
  Lines        6633     6655      +22     
==========================================
+ Hits         6330     6352      +22     
  Misses        303      303              
Impacted Files Coverage Δ
api/include/opentelemetry/trace/noop.h 86.21% <100.00%> (+1.60%) ⬆️
api/test/trace/noop_test.cc 100.00% <100.00%> (ø)
sdk/src/trace/tracer.cc 87.50% <100.00%> (+0.41%) ⬆️
sdk/test/trace/tracer_test.cc 99.46% <100.00%> (+0.01%) ⬆️

@lalitb lalitb merged commit 2383d99 into open-telemetry:main Jul 1, 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.

Parent-based sampler disconnected family trees
3 participants