otel-python

Python zero-code opentelemetry-distro0.54b1

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.54b1 0.54b1 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
10 Nov 2026, 07:50 UTC
Harness
9b99070 · measured in backtest-otel-python-0.54b1
Raw JSON
0.54b1.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-89ad8640,team=alpha
ot-baggage-routing-key rk-89ad8640
traceparent 00-618f8933b1a0d05eadfecfcff8c91c6e-95de2aff175b32d0-01
tracestate cptest=v1
x-cp-canary otel-python--http-http--0c359db6

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-89ad8640,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-618f8933b1a0d05eadfecfcff8c91c6e-33c20420264ba9c8-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--http-http--0c359db6
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-7f8b1729,team=alpha
ot-baggage-routing-key rk-7f8b1729
traceparent 00-858e56b59fb3f8b60587c257d8f7de56-57167dcf379363ea-01
tracestate cptest=v1
x-cp-canary otel-python--http-grpc--d5113a03

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-7f8b1729,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-858e56b59fb3f8b60587c257d8f7de56-fe8aa7409777cc05-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--http-grpc--d5113a03
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-72c4c02f,team=alpha
ot-baggage-routing-key rk-72c4c02f
traceparent 00-7fd7346398717cac6379400f7270d0f7-8f6c9ee292f0c51b-01
tracestate cptest=v1
x-cp-canary otel-python--http-kafka--44655870

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--http-kafka--44655870
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-dad7c782,team=alpha
ot-baggage-routing-key rk-dad7c782
traceparent 00-1f096a0d80bb58eedf3fedc9f77cbb91-153a779bb52dc821-01
tracestate cptest=v1
x-cp-canary otel-python--http-rabbitmq--f4d52300

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

baggage routing-key=rk-dad7c782,team=alpha
traceparent 00-1f096a0d80bb58eedf3fedc9f77cbb91-6a1d04fc7ecb7dd0-01
tracestate cptest=v1
test id
otel-python--http-rabbitmq--f4d52300
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-67272ba0,team=alpha
ot-baggage-routing-key rk-67272ba0
traceparent 00-651496424cb4714dd9cbaeb4e8237f9f-68eb12665e601416-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-http--705d102b

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-67272ba0,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-651496424cb4714dd9cbaeb4e8237f9f-8cf1be4d88246cbf-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--grpc-http--705d102b
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-3d7475ab,team=alpha
ot-baggage-routing-key rk-3d7475ab
traceparent 00-ae49e52afe3aa5de539c338063700bf5-a9d2ba5736daf87c-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-grpc--8a9d6c29

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-3d7475ab,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-ae49e52afe3aa5de539c338063700bf5-055b26e9e7c04c08-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--grpc-grpc--8a9d6c29
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-cac2a54d,team=alpha
ot-baggage-routing-key rk-cac2a54d
traceparent 00-d022d85d0b0a9d82963a106ae4239f73-a9d022eada4e2d22-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-kafka--9c51336d

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--grpc-kafka--9c51336d
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-c1035592,team=alpha
ot-baggage-routing-key rk-c1035592
traceparent 00-51e65b8f1b93e23ab9a5c9cf9c89ce0d-f91b02d3f8bad223-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-rabbitmq--5700250c

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

baggage routing-key=rk-c1035592,team=alpha
traceparent 00-51e65b8f1b93e23ab9a5c9cf9c89ce0d-4b32de5c30649da9-01
tracestate cptest=v1
test id
otel-python--grpc-rabbitmq--5700250c
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-5ea83b60,team=alpha
ot-baggage-routing-key rk-5ea83b60
traceparent 00-1abb1f53555db6e93dbebb8e827503d8-3973a668c516a85d-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-http--8b339eba

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-fa21b9de8273ac0da10aefa75cf4eb0f-bb235b14a735eb94-01
user-agent python-requests/2.34.2
test id
otel-python--kafka-http--8b339eba
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-515c146c,team=alpha
ot-baggage-routing-key rk-515c146c
traceparent 00-04528503ccfc5eea582be17bc858cf29-10ae4e00f8530ac0-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-grpc--22638db2

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-8fb5c292013e6172e00ae759fc81a8e1-24095dca202943a7-01
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--kafka-grpc--22638db2
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-351b3844,team=alpha
ot-baggage-routing-key rk-351b3844
traceparent 00-22599ec5e0d21ef0a08cc6d1f61bddea-aa0d2b66198444ad-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-kafka--f00a3d8b

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--kafka-kafka--f00a3d8b
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-accb3b8e,team=alpha
ot-baggage-routing-key rk-accb3b8e
traceparent 00-3b8f0c3537bd2f130729c804241cdbf6-a695b90f2081d47a-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-rabbitmq--737ceaeb

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

traceparent 00-d4b3b7854702ce8a1ad9ae66a2ad1ea0-82bbb5951d64c091-01
test id
otel-python--kafka-rabbitmq--737ceaeb
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-3bf4e82f,team=alpha
ot-baggage-routing-key rk-3bf4e82f
traceparent 00-d9d07990297fdc482cf3d0bd30883ffb-43f969ab34daf2f6-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-http--ccc4300d

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-3bf4e82f,team=alpha
connection keep-alive
content-length 51
content-type application/json
traceparent 00-d9d07990297fdc482cf3d0bd30883ffb-8211a1145e3eb073-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--rabbitmq-http--ccc4300d
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-c0290708,team=alpha
ot-baggage-routing-key rk-c0290708
traceparent 00-8fc009f3436ec89fe45842880ee8d073-48c323196656f1a2-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-grpc--bf9b9dc8

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-c0290708,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-8fc009f3436ec89fe45842880ee8d073-e2499316394b834e-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--rabbitmq-grpc--bf9b9dc8
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-84fc878b,team=alpha
ot-baggage-routing-key rk-84fc878b
traceparent 00-9e494cd474d2e8ce9c20909906ff0208-5c818e4bf0787390-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-kafka--14581272

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--rabbitmq-kafka--14581272
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-a7026cca,team=alpha
ot-baggage-routing-key rk-a7026cca
traceparent 00-008feafeb0c4bbe55e9d4c5659956d3b-a142d38de0a62d67-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-rabbitmq--847e340b

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

baggage routing-key=rk-a7026cca,team=alpha
traceparent 00-008feafeb0c4bbe55e9d4c5659956d3b-3683736b851c756c-01
tracestate cptest=v1
test id
otel-python--rabbitmq-rabbitmq--847e340b
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent

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