otel-python

Python zero-code opentelemetry-distro0.64b0

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.64b0 0.64b0 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:36 UTC
Harness
e793604 · measured in backtest-otel-python-0.64b0
Raw JSON
0.64b0.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-4a2eb9f6,team=alpha
ot-baggage-routing-key rk-4a2eb9f6
traceparent 00-b06b7fd304eec6bb8970f87abe870120-d50df3dbf323e4c3-01
tracestate cptest=v1
x-cp-canary otel-python--http-http--921f4bbc

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-4a2eb9f6,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-b06b7fd304eec6bb8970f87abe870120-b9e614912eddf087-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--http-http--921f4bbc
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-a8e52ff7,team=alpha
ot-baggage-routing-key rk-a8e52ff7
traceparent 00-679b31777d9f6dcd046b1f7227101e25-7fe85131b5dbffce-01
tracestate cptest=v1
x-cp-canary otel-python--http-grpc--3e8e4514

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-a8e52ff7,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-679b31777d9f6dcd046b1f7227101e25-7b5cd86b79fefec5-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--http-grpc--3e8e4514
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-1c4cac44,team=alpha
ot-baggage-routing-key rk-1c4cac44
traceparent 00-67b76801b75376bb0833fa4f3aaf8136-4400f69235b50366-01
tracestate cptest=v1
x-cp-canary otel-python--http-kafka--5128e257

Observed at the sink on the outbound Kafka record headers

baggage routing-key=rk-1c4cac44,team=alpha
traceparent 00-67b76801b75376bb0833fa4f3aaf8136-53a87318631eb4da-01
tracestate cptest=v1
test id
otel-python--http-kafka--5128e257
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-14a0d5c7,team=alpha
ot-baggage-routing-key rk-14a0d5c7
traceparent 00-c151ea982db673c779c4e7ce76c710eb-df3fbb097e9a2ef9-01
tracestate cptest=v1
x-cp-canary otel-python--http-rabbitmq--f1a04728

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

baggage routing-key=rk-14a0d5c7,team=alpha
traceparent 00-c151ea982db673c779c4e7ce76c710eb-da85e988357f65e5-01
tracestate cptest=v1
test id
otel-python--http-rabbitmq--f1a04728
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-7bab45df,team=alpha
ot-baggage-routing-key rk-7bab45df
traceparent 00-da26b4e53eb2cdfe21f49654e94a16e0-63b6bf3190967221-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-http--e505ec32

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-7bab45df,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-da26b4e53eb2cdfe21f49654e94a16e0-481811be6ea1c5eb-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--grpc-http--e505ec32
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-47bc75cb,team=alpha
ot-baggage-routing-key rk-47bc75cb
traceparent 00-25c1b793122cde5332262380f66aee64-a0bb323b976a854a-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-grpc--68facca4

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-47bc75cb,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-25c1b793122cde5332262380f66aee64-afecb19a7e5f6c77-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--grpc-grpc--68facca4
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-6d940276,team=alpha
ot-baggage-routing-key rk-6d940276
traceparent 00-fc49ef4fb8f44e10e11b178c48dda101-f1e042b5acdada16-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-kafka--8c853dc7

Observed at the sink on the outbound Kafka record headers

baggage routing-key=rk-6d940276,team=alpha
traceparent 00-fc49ef4fb8f44e10e11b178c48dda101-e73ddfd94b1f4d0c-01
tracestate cptest=v1
test id
otel-python--grpc-kafka--8c853dc7
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-480d4b96,team=alpha
ot-baggage-routing-key rk-480d4b96
traceparent 00-54bf5b38a5fb6fbc0446ff8bbd4dceba-54c97b136748cd3d-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-rabbitmq--89927c2e

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

baggage routing-key=rk-480d4b96,team=alpha
traceparent 00-54bf5b38a5fb6fbc0446ff8bbd4dceba-8609e7929a4baafc-01
tracestate cptest=v1
test id
otel-python--grpc-rabbitmq--89927c2e
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-f3e989ae,team=alpha
ot-baggage-routing-key rk-f3e989ae
traceparent 00-c79bd5b2d89b70bcd625a4a444121101-323e9ee2b6876148-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-http--8deac605

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-20af4a40e360b1daf95f9233a62bdea5-89465d258bb67447-03
user-agent python-requests/2.34.2
test id
otel-python--kafka-http--8deac605
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-1cd4399b,team=alpha
ot-baggage-routing-key rk-1cd4399b
traceparent 00-439f688ae7d7d45935bae854a9eb3aa6-39c506315dbd8b73-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-grpc--5e3cca93

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-d94bcf8cf0da36623ca8b81a5ef3586d-5afca6d162f2e924-03
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--kafka-grpc--5e3cca93
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-cfb622ee,team=alpha
ot-baggage-routing-key rk-cfb622ee
traceparent 00-5959a6b8f10d9a19ea372b078d499ec9-72295836206c11e6-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-kafka--c725edba

Observed at the sink on the outbound Kafka record headers

traceparent 00-28f0d893dbdbe6ec20a9ffd8da8203c4-593cd0cd7bbb29c3-03
test id
otel-python--kafka-kafka--c725edba
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-9269089e,team=alpha
ot-baggage-routing-key rk-9269089e
traceparent 00-b1e1637220c3dbce5ef4f7b831127057-221ba9ccd2a0dff7-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-rabbitmq--f023e64a

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

traceparent 00-30136db89dd71d6cb755956d3522f861-422c5c603230a021-03
test id
otel-python--kafka-rabbitmq--f023e64a
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-0f318e15,team=alpha
ot-baggage-routing-key rk-0f318e15
traceparent 00-de8bed150ef1517067533358834e1dda-50125cad9bd8034e-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-http--078cda8c

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-0f318e15,team=alpha
connection keep-alive
content-length 51
content-type application/json
traceparent 00-de8bed150ef1517067533358834e1dda-4093535d1ffe2bb9-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--rabbitmq-http--078cda8c
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-ed9f347c,team=alpha
ot-baggage-routing-key rk-ed9f347c
traceparent 00-649c42ac0e439063b9eb3c6373e9afa2-e03182d2a43472dc-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-grpc--5f0d1fdd

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-ed9f347c,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-649c42ac0e439063b9eb3c6373e9afa2-c8ca5c00b74f629b-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--rabbitmq-grpc--5f0d1fdd
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-db69b502,team=alpha
ot-baggage-routing-key rk-db69b502
traceparent 00-674dfb1f94c53cb63e1c9472394ed027-78d22728402e31ee-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-kafka--ebdfcdfb

Observed at the sink on the outbound Kafka record headers

baggage routing-key=rk-db69b502,team=alpha
traceparent 00-674dfb1f94c53cb63e1c9472394ed027-69c5f7e9a0675445-01
tracestate cptest=v1
test id
otel-python--rabbitmq-kafka--ebdfcdfb
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-28a2366c,team=alpha
ot-baggage-routing-key rk-28a2366c
traceparent 00-334d9b1e05ade40939b03329c8efccf3-4e252b9f38ab1314-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-rabbitmq--8ffdd250

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

baggage routing-key=rk-28a2366c,team=alpha
traceparent 00-334d9b1e05ade40939b03329c8efccf3-829c15753b7f2310-01
tracestate cptest=v1
test id
otel-python--rabbitmq-rabbitmq--8ffdd250
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent

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