otelhttptrace: fix header attributes lost when using sub-spans#8797
Open
imorte wants to merge 6 commits intoopen-telemetry:mainfrom
Open
otelhttptrace: fix header attributes lost when using sub-spans#8797imorte wants to merge 6 commits intoopen-telemetry:mainfrom
imorte wants to merge 6 commits intoopen-telemetry:mainfrom
Conversation
981aa28 to
5c75af3
Compare
Member
|
Could you add a changelog entry? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8797 +/- ##
=====================================
Coverage 83.4% 83.5%
=====================================
Files 192 192
Lines 15639 15636 -3
=====================================
+ Hits 13057 13065 +8
+ Misses 2134 2123 -11
Partials 448 448
🚀 New features to boost your workflow:
|
Author
done |
Member
|
With this change, we set ct.root twice in tge same method, both with the span from context. |
Author
fixed |
dmathieu
approved these changes
Apr 15, 2026
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.
When subspans are enabled (default),
wroteHeaderField()writes header attributes toct.rootwhich points to the already endedhttp.getconnsubspan.SetAttributeson an ended span is a silent noop, so allhttp.request.header.*attributes are quietly dropped.This works correctly with
WithoutSubSpans()becausect.rootis set to the parent span from context, which is still active.The fix sets
ct.rootto the parent span from context in both modes