You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2026-06-03 18:35:08 +02:00
8c91c83fb6
Problem - The Go SDK masks trace flags to the sampled bit and rejects version 00 flags > 0x02. - This drops the W3C Trace Context Level 2 random Trace ID flag (0x02) and any forward-compatible bits. Approach - Treat trace flags as an 8-bit bitmask across extract, storage, and inject. - Accept any flags for traceparent version 00 and preserve them unchanged. - Interpret only known bits for behavior (sampling uses 0x01); do not change sampling logic. Implementation details - propagation/trace_context.go - Inject: emit sc.TraceFlags() without masking. - Extract: remove opts[0] > 2 rejection; store full flags byte in SpanContextConfig.TraceFlags. - propagation/trace_context_test.go - Add extract cases for 0x02 and 0x03; ensure 0x09 is preserved. - Remove "unused bits set" from invalid cases. - Inject cases preserve 0xff, 0x02, and 0x03. - Future-version flag tests now expect full byte, not masked. Closes #7635 --------- Co-authored-by: Damien Mathieu <42@dmathieu.com>