Repository navigation
[SDK] Fix disabled Tracer StartSpan noop behavior - #4710
Merged
marcalff merged 3 commits intoOct 18, 2026
Merged
Conversation
dbarker
marked this pull request as ready for review
October 17, 2026 19:14
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4710 +/- ##
==========================================
+ Coverage 86.81% 86.81% +0.01%
==========================================
Files 525 525
Lines 20739 20741 +2
==========================================
+ Hits 18003 18005 +2
Misses 2736 2736
🚀 New features to boost your workflow:
|
1 of 3 tasks
malkia
added a commit
to malkia/opentelemetry-cpp
that referenced
this pull request
Oct 18, 2026
[SDK] Fix disabled Tracer StartSpan noop behavior (open-telemetry#4710)
2 of 3 tasks
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contributes to #4711
The current Tracer::StartSpan API and SDK disabled "noop behavior" is to return a non-recording span with an invalid span context, however the spec requires the noop span to contain the parent's context if valid. This is important to prevent breaking traces that propagate through libraries/processes where tracers or the entire SDK is disabled.
The spec defines the noop behavior here: https://opentelemetry.io/docs/specs/otel/trace/api/#behavior-of-the-api-in-the-absence-of-an-installed-sdk
This PR only addresses the SDK Tracer's disabled behavior to meet the spec. A follow up PR will be required to fix the API's noop tracer to meet the spec for when the SDK is fully disabled.
Changes
For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes