otel-python

Python zero-code opentelemetry-distro0.62b1

attach opentelemetry-instrument python app.py

36/64 cells pass
  • Pass
  • Partial
  • New trace
  • Fail
  • Undelivered
  • Not run

Explanations

OpenTelemetry carries the OpenTracing-era ot-baggage-* headers only with the opt-in ottrace propagator

config ot-baggage-* is a legacy OpenTracing convention. OpenTelemetry's default propagators are tracecontext and baggage; the OT Trace propagator that carries ot-baggage-* has to be selected.

The seeded ot-baggage-routing-key header is neither extracted nor re-emitted by any OpenTelemetry variant on any delivered boundary. Every variant here runs the SDK's default propagator set, tracecontext,baggage, and that set does not include the OpenTracing header format: OpenTelemetry standardised on W3C baggage, and the same values travel there instead.

The OpenTelemetry specification does list an opt-in OT Trace propagator (OTEL_PROPAGATORS=ottrace, marked deprecated) that reads and writes ot-tracer-traceid, ot-tracer-spanid, ot-tracer-sampled and ot-baggage-*, for applications migrating from OpenTracing. Several SDKs ship it as a separate package; it is never in the default set, and the harness has not measured it, so whether it makes these cells pass is documented, not verified.

The header outlives its deprecation only in Datadog's Java, Node and Go tracers, where it crosses all 16 boundaries as legacy behaviour of the datadog style (see datadog-ot-baggage-not-implemented for the Datadog tracers that do not carry it).

16 cells affected

otel-ot-baggage-not-default

OTel Python: confluent-kafka consumer links the producer context but never attaches it

open opentelemetry-instrumentation-confluent-kafka starts the consume span with the producer context as a link and never calls context.attach().

The poll() wrapper in opentelemetry-instrumentation-confluent-kafka (0.65b0) calls _create_new_consume_span, which does start_span(..., links=links) with the extracted producer context as a link. The package never calls opentelemetry.context.attach(), so the extracted context, and the baggage riding on it, is never made current for the code that processes the message. Every kafka->* leg therefore starts a new trace, and baggage and the foreign tracestate entry are gone. All eight RabbitMQ boundaries pass via opentelemetry-instrumentation-pika, whose per-message callback wrapper extracts and attaches before invoking the handler. The failure is a per-instrumentation design choice, not a language limitation.

Reported at least four times since 2023 across confluent-kafka, kafka-python and aiokafka. The only fix attempt (PR #1678) was closed unmerged by the stale bot; the maintainers' position (#3465) is that manually attaching the context is the intended usage.

Workaround: after poll(), run context.attach(propagate.extract(headers)) yourself before making outbound calls. Upstream fix: attach the extracted context (or make the consume span current) in the instrumentation, as the pika instrumentation already does. We found no upstream issue that names the baggage loss specifically.

12 cells affected

otel-python-confluent-kafka-consume-no-attach

Versions measured

Tracer
opentelemetry-distro 0.62b1 0.62b1 on pypi github
Runtime
python 3.12.16
Setup tier
zero-code Runtime attach only: an agent flag, a preload require, the CLR profiler environment, a php.ini extension. No application source involved.
Attach
opentelemetry-instrument python app.py
Relay source
relays/python
Ran at
1 Nov 2026, 03:38 UTC
Harness
e793604 · measured in backtest-otel-python-0.62b1
Raw JSON
0.62b1.json → variants[id = "otel-python"]

Libraries

confluent-kafka2.15.0
flask3.1.3
grpcio1.83.1
rabbitmqpika 1.4.4
requests2.34.2

Configuration

OTEL_PROPAGATORStracecontext,baggage
OTEL_TRACES_EXPORTERnone

Evidence per hop

What the driver seeded and what the sink observed, one entry per boundary.

HTTP HTTP baggage tracestate traceparent ot-baggage delivered via http

Seeded on the inbound HTTP request headers

baggage routing-key=rk-3a826878,team=alpha
ot-baggage-routing-key rk-3a826878
traceparent 00-e72d79b3efee2c24272f00803006ad9b-66c6e1ebd2bef202-01
tracestate cptest=v1
x-cp-canary otel-python--http-http--3a363dae

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-3a826878,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-e72d79b3efee2c24272f00803006ad9b-5df6f766b0f5b3e2-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--http-http--3a363dae
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent
HTTP gRPC baggage tracestate traceparent ot-baggage delivered via grpc

Seeded on the inbound HTTP request headers

baggage routing-key=rk-a0ffa8c0,team=alpha
ot-baggage-routing-key rk-a0ffa8c0
traceparent 00-97a018d4be58d046bde0321fc99f9ad8-553aa462094f7210-01
tracestate cptest=v1
x-cp-canary otel-python--http-grpc--5721851c

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-a0ffa8c0,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-97a018d4be58d046bde0321fc99f9ad8-850552da227e8b3e-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--http-grpc--5721851c
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent
HTTP Kafka baggage tracestate traceparent ot-baggage delivered via kafka

Seeded on the inbound HTTP request headers

baggage routing-key=rk-0237f785,team=alpha
ot-baggage-routing-key rk-0237f785
traceparent 00-606dccb40afd77202dc63dcb7affdfa3-84597e03aa136575-01
tracestate cptest=v1
x-cp-canary otel-python--http-kafka--7462c4f2

Observed at the sink on the outbound Kafka record headers

baggage routing-key=rk-0237f785,team=alpha
traceparent 00-606dccb40afd77202dc63dcb7affdfa3-cfe5f9c00c10557f-01
tracestate cptest=v1
test id
otel-python--http-kafka--7462c4f2
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent
HTTP RabbitMQ baggage tracestate traceparent ot-baggage delivered via rabbitmq

Seeded on the inbound HTTP request headers

baggage routing-key=rk-456a420a,team=alpha
ot-baggage-routing-key rk-456a420a
traceparent 00-a2d35719354a9e3459b60e1e2fc9dbc2-512c903f0faa05d5-01
tracestate cptest=v1
x-cp-canary otel-python--http-rabbitmq--e1d794a2

Observed at the sink on the outbound AMQP 0-9-1 message headers

baggage routing-key=rk-456a420a,team=alpha
traceparent 00-a2d35719354a9e3459b60e1e2fc9dbc2-dfb631f553e3c6a4-01
tracestate cptest=v1
test id
otel-python--http-rabbitmq--e1d794a2
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent
gRPC HTTP baggage tracestate traceparent ot-baggage delivered via http

Seeded on the inbound gRPC metadata

baggage routing-key=rk-20ddb9a3,team=alpha
ot-baggage-routing-key rk-20ddb9a3
traceparent 00-4175cdad815877d30c360fec3b3a5a24-3f29b879136bd53a-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-http--6d4cd562

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-20ddb9a3,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-4175cdad815877d30c360fec3b3a5a24-f2ffa8fa0768666c-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--grpc-http--6d4cd562
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent
gRPC gRPC baggage tracestate traceparent ot-baggage delivered via grpc

Seeded on the inbound gRPC metadata

baggage routing-key=rk-b70b0571,team=alpha
ot-baggage-routing-key rk-b70b0571
traceparent 00-b1d959064b6bf99f4279b0413c97b8dc-565daffd1e63877e-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-grpc--e0e66916

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-b70b0571,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-b1d959064b6bf99f4279b0413c97b8dc-54eda9506624efaa-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--grpc-grpc--e0e66916
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent
gRPC Kafka baggage tracestate traceparent ot-baggage delivered via kafka

Seeded on the inbound gRPC metadata

baggage routing-key=rk-957d14c2,team=alpha
ot-baggage-routing-key rk-957d14c2
traceparent 00-333a0bf63f8812c3de3cfc5f74b742be-5528de00e626901f-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-kafka--e4ae29d8

Observed at the sink on the outbound Kafka record headers

baggage routing-key=rk-957d14c2,team=alpha
traceparent 00-333a0bf63f8812c3de3cfc5f74b742be-6e0867bcb57887ac-01
tracestate cptest=v1
test id
otel-python--grpc-kafka--e4ae29d8
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent
gRPC RabbitMQ baggage tracestate traceparent ot-baggage delivered via rabbitmq

Seeded on the inbound gRPC metadata

baggage routing-key=rk-260748f1,team=alpha
ot-baggage-routing-key rk-260748f1
traceparent 00-17b12d56966db67b080ee7a4661b9e30-2bf272009bd5e430-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-rabbitmq--ad9f44ab

Observed at the sink on the outbound AMQP 0-9-1 message headers

baggage routing-key=rk-260748f1,team=alpha
traceparent 00-17b12d56966db67b080ee7a4661b9e30-7b44be040c98fb76-01
tracestate cptest=v1
test id
otel-python--grpc-rabbitmq--ad9f44ab
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent
Kafka HTTP baggage tracestate traceparent ot-baggage delivered via http

Seeded on the inbound Kafka record headers

baggage routing-key=rk-b288ae12,team=alpha
ot-baggage-routing-key rk-b288ae12
traceparent 00-51777a1dcc6ca7200a97a5655bce1deb-3a06127333ae8370-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-http--333cdc68

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
connection keep-alive
content-length 48
content-type application/json
traceparent 00-7632a6d045d202d84676a25d1ae78788-9003ac563989177a-01
user-agent python-requests/2.34.2
test id
otel-python--kafka-http--333cdc68
raw statuses
baggage=absenttracestate=absenttraceparent=new_traceot_baggage=absent
Kafka gRPC baggage tracestate traceparent ot-baggage delivered via grpc

Seeded on the inbound Kafka record headers

baggage routing-key=rk-0a246045,team=alpha
ot-baggage-routing-key rk-0a246045
traceparent 00-dbc98c8df42b7bb3b25c27a8f7d85f68-7a0573a6f29e5712-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-grpc--3241b4e8

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-d95fb23bda97693c1bfee83dd0436050-4024138be848d07d-01
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--kafka-grpc--3241b4e8
raw statuses
baggage=absenttracestate=absenttraceparent=new_traceot_baggage=absent
Kafka Kafka baggage tracestate traceparent ot-baggage delivered via kafka

Seeded on the inbound Kafka record headers

baggage routing-key=rk-b246b9be,team=alpha
ot-baggage-routing-key rk-b246b9be
traceparent 00-37e7b2de310f654d38301e00d5d5cdfe-9ab908d29a0ee4f1-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-kafka--4414b918

Observed at the sink on the outbound Kafka record headers

traceparent 00-73f9f07764fc78b967185ca025cf7c16-9a03bd093e5d51b1-01
test id
otel-python--kafka-kafka--4414b918
raw statuses
baggage=absenttracestate=absenttraceparent=new_traceot_baggage=absent
Kafka RabbitMQ baggage tracestate traceparent ot-baggage delivered via rabbitmq

Seeded on the inbound Kafka record headers

baggage routing-key=rk-3b4c87e4,team=alpha
ot-baggage-routing-key rk-3b4c87e4
traceparent 00-b86bad35ef8c20d026cf9555c1ddfbd9-1ed4137750333ab7-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-rabbitmq--addc0810

Observed at the sink on the outbound AMQP 0-9-1 message headers

traceparent 00-b351ea314dff52171cebe07407374cac-a493d4fd63013d78-01
test id
otel-python--kafka-rabbitmq--addc0810
raw statuses
baggage=absenttracestate=absenttraceparent=new_traceot_baggage=absent
RabbitMQ HTTP baggage tracestate traceparent ot-baggage delivered via http

Seeded on the inbound AMQP 0-9-1 message headers

baggage routing-key=rk-063dd04c,team=alpha
ot-baggage-routing-key rk-063dd04c
traceparent 00-aaadc804093615935a3929ea19fa717f-21d2ff41a2ba8022-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-http--cd7d56f4

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-063dd04c,team=alpha
connection keep-alive
content-length 51
content-type application/json
traceparent 00-aaadc804093615935a3929ea19fa717f-d088ffa674a8268c-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--rabbitmq-http--cd7d56f4
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent
RabbitMQ gRPC baggage tracestate traceparent ot-baggage delivered via grpc

Seeded on the inbound AMQP 0-9-1 message headers

baggage routing-key=rk-33810019,team=alpha
ot-baggage-routing-key rk-33810019
traceparent 00-999c906c0ac4f994062dd6387aa09e33-61551a64b2854b7f-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-grpc--e33950b7

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-33810019,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-999c906c0ac4f994062dd6387aa09e33-22969a7eb90acaf7-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--rabbitmq-grpc--e33950b7
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent
RabbitMQ Kafka baggage tracestate traceparent ot-baggage delivered via kafka

Seeded on the inbound AMQP 0-9-1 message headers

baggage routing-key=rk-4d72e421,team=alpha
ot-baggage-routing-key rk-4d72e421
traceparent 00-005eeb474dc58b3b1511d5a5245e3291-751d433bc7f674c2-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-kafka--a3c8eb0a

Observed at the sink on the outbound Kafka record headers

baggage routing-key=rk-4d72e421,team=alpha
traceparent 00-005eeb474dc58b3b1511d5a5245e3291-99097ed1007a5cf2-01
tracestate cptest=v1
test id
otel-python--rabbitmq-kafka--a3c8eb0a
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent
RabbitMQ RabbitMQ baggage tracestate traceparent ot-baggage delivered via rabbitmq

Seeded on the inbound AMQP 0-9-1 message headers

baggage routing-key=rk-9bfcbc05,team=alpha
ot-baggage-routing-key rk-9bfcbc05
traceparent 00-b5b513d305bb4d3ddc6c72c94ff4da14-d6336140ea0fe4bd-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-rabbitmq--85ca58c2

Observed at the sink on the outbound AMQP 0-9-1 message headers

baggage routing-key=rk-9bfcbc05,team=alpha
traceparent 00-b5b513d305bb4d3ddc6c72c94ff4da14-60f6d178c650587e-01
tracestate cptest=v1
test id
otel-python--rabbitmq-rabbitmq--85ca58c2
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent

Cells are generated by the harness, never transcribed from documentation. Report a wrong one.