Repository navigation
[API] Preserve parent SpanContext in NoopTracer spans - #4717
Merged
marcalff merged 3 commits intoOct 20, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4717 +/- ##
==========================================
+ Coverage 86.81% 86.82% +0.01%
==========================================
Files 525 525
Lines 20736 20750 +14
==========================================
+ Hits 18000 18014 +14
Misses 2736 2736
🚀 New features to boost your workflow:
|
lalitb
reviewed
Oct 19, 2026
| { | ||
| return noop_span_; | ||
| } | ||
| return nostd::shared_ptr<Span>{std::make_shared<DefaultSpan>(parent_context)}; |
Member
There was a problem hiding this comment.
This allocates inside noexcept, so an allocation failure could crash the application. But this is a wider API issue already tracked in #3013, so I won’t block this PR on it.
lalitb
reviewed
Oct 19, 2026
| const StartSpanOptions &options) noexcept override | ||
| { | ||
| return noop_span_; | ||
| const auto parent_context = [&options]() noexcept -> SpanContext { |
Member
There was a problem hiding this comment.
This changes the inline API behavior: a no-op span now keeps the parent context instead of returning an invalid one. I’m okay with accepting this as a correctness-fix exception for v1.
lalitb
approved these changes
Oct 19, 2026
lalitb
left a comment
Member
There was a problem hiding this comment.
LGTM once the IWYU failures are fixed.
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.
Fixes #4711
Follow-up to #4710: preserve a valid parent SpanContext when
NoopTracer::StartSpancreates a non-recording span.Changes
CHANGELOG.md.CHANGELOG.mdupdated for non-trivial changes