otel-python

Python zero-code opentelemetry-distro0.62b0

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.62b0 0.62b0 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.62b0
Raw JSON
0.62b0.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-82cdc8a2,team=alpha
ot-baggage-routing-key rk-82cdc8a2
traceparent 00-dd00147242cd79b34d17b1e79a985063-d0786a2f4ff9ef22-01
tracestate cptest=v1
x-cp-canary otel-python--http-http--0c633e1f

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-82cdc8a2,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-dd00147242cd79b34d17b1e79a985063-5180f9fc90876434-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--http-http--0c633e1f
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-c8775a2c,team=alpha
ot-baggage-routing-key rk-c8775a2c
traceparent 00-c720c4acb4e2331b601b6680c6d5aa7e-4571963532e79931-01
tracestate cptest=v1
x-cp-canary otel-python--http-grpc--3f0bd7cb

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-c8775a2c,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-c720c4acb4e2331b601b6680c6d5aa7e-b10b470c1b4fbb37-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--http-grpc--3f0bd7cb
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-1b106d16,team=alpha
ot-baggage-routing-key rk-1b106d16
traceparent 00-cc9f31f51011ea7aae7a3346be525834-b872d3efb8113b18-01
tracestate cptest=v1
x-cp-canary otel-python--http-kafka--d066a6a2

Observed at the sink on the outbound Kafka record headers

baggage routing-key=rk-1b106d16,team=alpha
traceparent 00-cc9f31f51011ea7aae7a3346be525834-bd05619c515f7ff8-01
tracestate cptest=v1
test id
otel-python--http-kafka--d066a6a2
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-796fba70,team=alpha
ot-baggage-routing-key rk-796fba70
traceparent 00-6742a7e269232fde59f637cdf73dbe58-3eadb881f0e6d487-01
tracestate cptest=v1
x-cp-canary otel-python--http-rabbitmq--1df3303a

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

baggage routing-key=rk-796fba70,team=alpha
traceparent 00-6742a7e269232fde59f637cdf73dbe58-047f166cc7204be7-01
tracestate cptest=v1
test id
otel-python--http-rabbitmq--1df3303a
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-35aa8711,team=alpha
ot-baggage-routing-key rk-35aa8711
traceparent 00-e390738734b851bb147ce0ef86b05506-a7f61e2ce586a843-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-http--4691cf51

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-35aa8711,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-e390738734b851bb147ce0ef86b05506-fcde15d5cb16731c-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--grpc-http--4691cf51
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-85ed1c8b,team=alpha
ot-baggage-routing-key rk-85ed1c8b
traceparent 00-66b290b2786c55ea437a3d3e11082b4c-2ec1367762d86532-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-grpc--8ab2ad5f

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-85ed1c8b,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-66b290b2786c55ea437a3d3e11082b4c-3d6918333cd9b70b-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--grpc-grpc--8ab2ad5f
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-eaa83f85,team=alpha
ot-baggage-routing-key rk-eaa83f85
traceparent 00-41dc98d33785fdf646c6ed2c5cd776ee-db4c10b1eac742d7-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-kafka--c1769d4f

Observed at the sink on the outbound Kafka record headers

baggage routing-key=rk-eaa83f85,team=alpha
traceparent 00-41dc98d33785fdf646c6ed2c5cd776ee-95201619f3cfce7b-01
tracestate cptest=v1
test id
otel-python--grpc-kafka--c1769d4f
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-74b96fcb,team=alpha
ot-baggage-routing-key rk-74b96fcb
traceparent 00-ece72402ed1b9329d4a66d828c006301-fe51da195433b789-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-rabbitmq--e1aa9725

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

baggage routing-key=rk-74b96fcb,team=alpha
traceparent 00-ece72402ed1b9329d4a66d828c006301-9a8e93e0e3c6a415-01
tracestate cptest=v1
test id
otel-python--grpc-rabbitmq--e1aa9725
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-9e9d8dcf,team=alpha
ot-baggage-routing-key rk-9e9d8dcf
traceparent 00-5dbb829a54d1ccc9a9ca8a4602286208-a681c0455506e524-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-http--16e775c8

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-bf1109545fb2f95006f9a3b01da8cfd5-b7d580f3e4845312-01
user-agent python-requests/2.34.2
test id
otel-python--kafka-http--16e775c8
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-6e8742e4,team=alpha
ot-baggage-routing-key rk-6e8742e4
traceparent 00-37437aa2f5a2100a46706e7c3aa742a1-fee63d01fda74783-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-grpc--9aceea80

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-88f223d8d322dac8a2bc8fca0aa0481a-4bde306211c94bd4-01
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--kafka-grpc--9aceea80
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-dcbb621c,team=alpha
ot-baggage-routing-key rk-dcbb621c
traceparent 00-a84f8b6d4e4614edd91e72ec6633409b-785e463b419a8960-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-kafka--e744e89c

Observed at the sink on the outbound Kafka record headers

traceparent 00-f9b1018d035c5fb0d2cfd03e971a9127-0307e4461a66dea5-01
test id
otel-python--kafka-kafka--e744e89c
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-0ccc62e7,team=alpha
ot-baggage-routing-key rk-0ccc62e7
traceparent 00-b18556eb3dc33cd31033411a44cf1dff-49a1f37a3755bd1d-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-rabbitmq--e2bc6aae

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

traceparent 00-bead8f884615b9243b4ed5895242fd64-00d5caa007ed7e55-01
test id
otel-python--kafka-rabbitmq--e2bc6aae
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-8bcf7c56,team=alpha
ot-baggage-routing-key rk-8bcf7c56
traceparent 00-774ad926f0ac34a6a63436985dabd50c-bf3455ad8904b3fb-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-http--b448aad5

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-8bcf7c56,team=alpha
connection keep-alive
content-length 51
content-type application/json
traceparent 00-774ad926f0ac34a6a63436985dabd50c-b5af2ab8a2395fc0-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--rabbitmq-http--b448aad5
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-0c157d2c,team=alpha
ot-baggage-routing-key rk-0c157d2c
traceparent 00-80a0c57bb15a99309a3537d57f91b4a5-21be3e62bb242744-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-grpc--a355b86f

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-0c157d2c,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-80a0c57bb15a99309a3537d57f91b4a5-8f6b3a0910d099ee-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--rabbitmq-grpc--a355b86f
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-1a3290ae,team=alpha
ot-baggage-routing-key rk-1a3290ae
traceparent 00-ee37ee1edc06afd76863621d476ef3ac-2374fe403bb212ef-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-kafka--b40f4fa9

Observed at the sink on the outbound Kafka record headers

baggage routing-key=rk-1a3290ae,team=alpha
traceparent 00-ee37ee1edc06afd76863621d476ef3ac-846652e8772bb627-01
tracestate cptest=v1
test id
otel-python--rabbitmq-kafka--b40f4fa9
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-c8aa1b40,team=alpha
ot-baggage-routing-key rk-c8aa1b40
traceparent 00-1bf985344784ad19ef6d2c1a97671de5-afee251e01e035f3-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-rabbitmq--4252645d

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

baggage routing-key=rk-c8aa1b40,team=alpha
traceparent 00-1bf985344784ad19ef6d2c1a97671de5-4f22e3eb437e0935-01
tracestate cptest=v1
test id
otel-python--rabbitmq-rabbitmq--4252645d
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent

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