otel-python

Python zero-code opentelemetry-distro0.61b0

attach opentelemetry-instrument python app.py

27/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.61b0 0.61b0 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
9 Nov 2026, 19:42 UTC
Harness
9b99070 · measured in backtest-otel-python-0.61b0
Raw JSON
0.61b0.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-6936b9a6,team=alpha
ot-baggage-routing-key rk-6936b9a6
traceparent 00-ac7f6d38fba5ce4935e2a1c358fb0ee4-0abcdac1fce29195-01
tracestate cptest=v1
x-cp-canary otel-python--http-http--4c69dbc8

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-6936b9a6,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-ac7f6d38fba5ce4935e2a1c358fb0ee4-46b3425eb3f3f485-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--http-http--4c69dbc8
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-5ed78c13,team=alpha
ot-baggage-routing-key rk-5ed78c13
traceparent 00-80e84c3b6de4eba2af944b08cf13d2ed-8e25b6cb0d61947b-01
tracestate cptest=v1
x-cp-canary otel-python--http-grpc--58db4784

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-5ed78c13,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-80e84c3b6de4eba2af944b08cf13d2ed-92fcea45b59d75a3-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--http-grpc--58db4784
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-2e84635f,team=alpha
ot-baggage-routing-key rk-2e84635f
traceparent 00-075dbf1f7285b24bbcb6c3b98aabc2f6-9afa74424601d1ef-01
tracestate cptest=v1
x-cp-canary otel-python--http-kafka--23f215ff

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--http-kafka--23f215ff
raw statuses
baggage=absenttracestate=absenttraceparent=absentot_baggage=absent
HTTP RabbitMQ baggage tracestate traceparent ot-baggage delivered via rabbitmq

Seeded on the inbound HTTP request headers

baggage routing-key=rk-8cba0b48,team=alpha
ot-baggage-routing-key rk-8cba0b48
traceparent 00-6cfc92c7b5946211e608f286d60f461d-018bdac3532060e6-01
tracestate cptest=v1
x-cp-canary otel-python--http-rabbitmq--58dabda5

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

baggage routing-key=rk-8cba0b48,team=alpha
traceparent 00-6cfc92c7b5946211e608f286d60f461d-d93b3c3c1aaed047-01
tracestate cptest=v1
test id
otel-python--http-rabbitmq--58dabda5
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-9b53c0ec,team=alpha
ot-baggage-routing-key rk-9b53c0ec
traceparent 00-1904277a898429cd427571d904c4ae16-d717573f307bb78d-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-http--c6b73103

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-9b53c0ec,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-1904277a898429cd427571d904c4ae16-35d6ec4628f31c15-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--grpc-http--c6b73103
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-de7aabf4,team=alpha
ot-baggage-routing-key rk-de7aabf4
traceparent 00-63a603ec44068e2d00ad3ccf1c20ae9b-f7a38f6fa0bf90c3-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-grpc--32d7d5d1

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-de7aabf4,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-63a603ec44068e2d00ad3ccf1c20ae9b-968694f16ae2780b-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--grpc-grpc--32d7d5d1
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-c0cab2f4,team=alpha
ot-baggage-routing-key rk-c0cab2f4
traceparent 00-7590a28c1ff9c2d0f7cfb8a27f72726d-55fe1f53f44032a5-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-kafka--1771dfd9

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--grpc-kafka--1771dfd9
raw statuses
baggage=absenttracestate=absenttraceparent=absentot_baggage=absent
gRPC RabbitMQ baggage tracestate traceparent ot-baggage delivered via rabbitmq

Seeded on the inbound gRPC metadata

baggage routing-key=rk-473a1424,team=alpha
ot-baggage-routing-key rk-473a1424
traceparent 00-a2a4d0eee298c073168b4b56e67a0d1f-9e204b72d6e83201-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-rabbitmq--b2205dc3

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

baggage routing-key=rk-473a1424,team=alpha
traceparent 00-a2a4d0eee298c073168b4b56e67a0d1f-886c12dab25a9cdf-01
tracestate cptest=v1
test id
otel-python--grpc-rabbitmq--b2205dc3
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-c7ca4119,team=alpha
ot-baggage-routing-key rk-c7ca4119
traceparent 00-2d5fb42d4d6f1839fd2ecc9ded705a3f-84c687c7d0aabaf3-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-http--bf32d3be

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-07403506db1711e6cfb0127c97f0c877-1f6bc9c5f5abe19b-01
user-agent python-requests/2.34.2
test id
otel-python--kafka-http--bf32d3be
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-15610aa5,team=alpha
ot-baggage-routing-key rk-15610aa5
traceparent 00-1a45e22c46cb02f0bf0e3523b8b6b0fd-2d04fb1de190b879-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-grpc--12e28753

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-40132e91f255d9ec6bd6ed42fd3bb7ed-167f1d00ee591fda-01
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--kafka-grpc--12e28753
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-e60ef048,team=alpha
ot-baggage-routing-key rk-e60ef048
traceparent 00-b05a05fca26fb7fd61e2340a31a75334-8afc7f090474a6e4-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-kafka--d91477e0

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--kafka-kafka--d91477e0
raw statuses
baggage=absenttracestate=absenttraceparent=absentot_baggage=absent
Kafka RabbitMQ baggage tracestate traceparent ot-baggage delivered via rabbitmq

Seeded on the inbound Kafka record headers

baggage routing-key=rk-25fc9f25,team=alpha
ot-baggage-routing-key rk-25fc9f25
traceparent 00-ff9e501de38a069791c5b39a7a6796e4-5a284de56616caf0-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-rabbitmq--05aa5d0c

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

traceparent 00-5e4c29208d7de1104ab3d3ab6ef56372-b7e4f5a11a597c1e-01
test id
otel-python--kafka-rabbitmq--05aa5d0c
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-6bdd5196,team=alpha
ot-baggage-routing-key rk-6bdd5196
traceparent 00-41ab2ad23416508dca1bb6e440413cf7-8861b22e3e448bb4-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-http--7e3e1985

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-6bdd5196,team=alpha
connection keep-alive
content-length 51
content-type application/json
traceparent 00-41ab2ad23416508dca1bb6e440413cf7-cc01fc7c9b2d3f76-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--rabbitmq-http--7e3e1985
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-b19699d2,team=alpha
ot-baggage-routing-key rk-b19699d2
traceparent 00-5d74a06ecd1778c0333336bb0d4979ba-8ea21bbbd73c9f35-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-grpc--91860c5d

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-b19699d2,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-5d74a06ecd1778c0333336bb0d4979ba-cfcd51b44abf6878-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--rabbitmq-grpc--91860c5d
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-31f5383c,team=alpha
ot-baggage-routing-key rk-31f5383c
traceparent 00-fcfde9e0468f1827706c9f3dd3424160-d808a9ab8d9c043e-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-kafka--e150ac55

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--rabbitmq-kafka--e150ac55
raw statuses
baggage=absenttracestate=absenttraceparent=absentot_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-59d14f31,team=alpha
ot-baggage-routing-key rk-59d14f31
traceparent 00-1e4e954fbe8166a1287d4e85499d2acc-b968a7ff41b6fc81-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-rabbitmq--a2ec23b9

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

baggage routing-key=rk-59d14f31,team=alpha
traceparent 00-1e4e954fbe8166a1287d4e85499d2acc-cd3c2917af94293a-01
tracestate cptest=v1
test id
otel-python--rabbitmq-rabbitmq--a2ec23b9
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent

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