You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
📣 Public-facing draft — to be opened upstream in open-telemetry/opentelemetry-python. No internal references; copy verbatim.
Title: B3 propagators drop the received debug flag instead of re-propagating it
Description
The B3 propagators in opentelemetry-propagator-b3 do not preserve a received B3 debug flag. On extract, the debug indicator (d in the single header, x-b3-flags: 1 in the multi header) is collapsed into the SAMPLED trace flag and the fact that it was a debug flag is lost. On inject, the propagator only ever emits 1/0, so a downstream service never sees the debug flag that an upstream service sent.
Extract (~L97-103): if sampled in self._SAMPLE_PROPAGATE_VALUES or flags == "1": options |= trace.TraceFlags.SAMPLED — the d/flags input only sets SAMPLED; the debug state is never stored.
Multi-header inject (~L140): setter.set(carrier, self.SAMPLED_KEY, "1" if sampled else "0") — never emits x-b3-flags.
Single-header inject (~L172-176): the sampling field is only ever "1"/"0", never "d".
Spec
specification/context/api-propagators.md (B3 requirements): B3 implementations MUST support the debug (d) flag, and a received debug flag MUST be preserved and re-propagated to downstream services.
Reference implementation
OpenTelemetry Java stores the received B3 debug flag in a context entry on extract and re-emits it on inject (X-B3-Flags: 1 for multi-header, d in the sampling position for single-header).
Proposed fix
On extract, store the received debug state in a dedicated context key. On inject, re-emit it — X-B3-Flags: 1 for the multi-header format and d in the single-header sampling position — whenever the debug flag was received. Normal sampled/unsampled behavior is unchanged.
Activity
ocelotl commentedon Jul 22, 2026
🔒 Internal (dash0) — not for upstream.
Tracking for the B3 debug-flag fix.
oss_15_b3_debug_flag_propagation500252382ocelotl commentedon Jul 22, 2026
📣 Public-facing draft — to be opened upstream in
open-telemetry/opentelemetry-python. No internal references; copy verbatim.Title: B3 propagators drop the received debug flag instead of re-propagating it
Description
The B3 propagators in
opentelemetry-propagator-b3do not preserve a received B3 debug flag. On extract, the debug indicator (din the single header,x-b3-flags: 1in the multi header) is collapsed into theSAMPLEDtrace flag and the fact that it was a debug flag is lost. On inject, the propagator only ever emits1/0, so a downstream service never sees the debug flag that an upstream service sent.Evidence
propagator/opentelemetry-propagator-b3/src/opentelemetry/propagators/b3/__init__.py:if sampled in self._SAMPLE_PROPAGATE_VALUES or flags == "1": options |= trace.TraceFlags.SAMPLED— thed/flags input only sets SAMPLED; the debug state is never stored.setter.set(carrier, self.SAMPLED_KEY, "1" if sampled else "0")— never emitsx-b3-flags."1"/"0", never"d".Spec
specification/context/api-propagators.md(B3 requirements): B3 implementations MUST support the debug (d) flag, and a received debug flag MUST be preserved and re-propagated to downstream services.Reference implementation
OpenTelemetry Java stores the received B3 debug flag in a context entry on extract and re-emits it on inject (
X-B3-Flags: 1for multi-header,din the sampling position for single-header).Proposed fix
On extract, store the received debug state in a dedicated context key. On inject, re-emit it —
X-B3-Flags: 1for the multi-header format anddin the single-header sampling position — whenever the debug flag was received. Normal sampled/unsampled behavior is unchanged.