Skip to content

Conversation

@nikhilmantri0902
Copy link
Contributor

Closes #7436

Span.Flags should include:
Bits 0–7: span’s W3C TraceFlags (e.g., sampled)
Bits 8–9: “has parent isRemote” and “parent isRemote” per OTLP spec

Update the trace exporter to include the span’s W3C trace flags in the lower 8 bits and keep the existing 8–9 isRemote logic.
Conceptually:
For spans: flags := uint32(sd.SpanContext().TraceFlags() & 0xff)
Always set SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK
If sd.Parent().IsRemote(), also set SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK
Assign s.Flags = flags
Apply the same for links using the link’s SpanContext.TraceFlags() for bits 0–7 and the link’s SpanContext.IsRemote() for bits 8–9.

@codecov
Copy link

codecov bot commented Oct 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.1%. Comparing base (07a26be) to head (d504a2c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #7438   +/-   ##
=====================================
  Coverage   86.1%   86.1%           
=====================================
  Files        291     291           
  Lines      25613   25615    +2     
=====================================
+ Hits       22056   22059    +3     
+ Misses      3184    3183    -1     
  Partials     373     373           
Files with missing lines Coverage Δ
...ers/otlp/otlptrace/internal/tracetransform/span.go 93.2% <100.0%> (+<0.1%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nikhilmantri0902
Copy link
Contributor Author

nikhilmantri0902 commented Oct 5, 2025

@dmathieu can we merge this? Resolving conflicts.

@dmathieu
Copy link
Member

dmathieu commented Oct 5, 2025

We require 2 approvals.

@nikhilmantri0902
Copy link
Contributor Author

@flc1125 can you take a look please?

@flc1125
Copy link
Member

flc1125 commented Oct 9, 2025

@flc1125 can you take a look please?

Sorry, I was on vacation recently. Just got back and have been quite busy lately. I need some time.

@dmathieu dmathieu merged commit fa8e48b into open-telemetry:main Oct 13, 2025
32 checks passed
@MrAlias MrAlias added this to the v1.39.0 milestone Oct 14, 2025
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.

OTLP trace exporter does not include W3C trace flags (bits 0–7) in Span.Flags; only sets parent isRemote bits (8–9)

4 participants