otel-python

Python zero-code opentelemetry-distro0.54b0

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.54b0 0.54b0 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:54 UTC
Harness
9b99070 · measured in backtest-otel-python-0.54b0
Raw JSON
0.54b0.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-efe8e25d,team=alpha
ot-baggage-routing-key rk-efe8e25d
traceparent 00-13ff0e1e8f161e2745c928453a26431d-e8df13fb7277834d-01
tracestate cptest=v1
x-cp-canary otel-python--http-http--0f36b120

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-efe8e25d,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-13ff0e1e8f161e2745c928453a26431d-15f9c3bf256cb8e4-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--http-http--0f36b120
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-600983b9,team=alpha
ot-baggage-routing-key rk-600983b9
traceparent 00-1b92351915c7e8a772c2374f17fa2176-e204295d0ade3b6c-01
tracestate cptest=v1
x-cp-canary otel-python--http-grpc--cf3b3570

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-600983b9,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-1b92351915c7e8a772c2374f17fa2176-88b05b2096276cb5-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--http-grpc--cf3b3570
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-f4840bd3,team=alpha
ot-baggage-routing-key rk-f4840bd3
traceparent 00-7a9a78338393b11a4c8c53bc1ab3b20f-f3ab58e40ef9623a-01
tracestate cptest=v1
x-cp-canary otel-python--http-kafka--9a49c881

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--http-kafka--9a49c881
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-fe8abcaf,team=alpha
ot-baggage-routing-key rk-fe8abcaf
traceparent 00-8fc3cb4af9b633566fe72166c4769c21-e29e5f737ae7f2c8-01
tracestate cptest=v1
x-cp-canary otel-python--http-rabbitmq--724903c9

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

baggage routing-key=rk-fe8abcaf,team=alpha
traceparent 00-8fc3cb4af9b633566fe72166c4769c21-ca2ab0e3bab33ac2-01
tracestate cptest=v1
test id
otel-python--http-rabbitmq--724903c9
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-be58a514,team=alpha
ot-baggage-routing-key rk-be58a514
traceparent 00-60b70ded7dc04f03264d719877431b81-d1320df59c87445b-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-http--9339b54c

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-be58a514,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-60b70ded7dc04f03264d719877431b81-a9f5111275a61ace-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--grpc-http--9339b54c
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-d2a730ff,team=alpha
ot-baggage-routing-key rk-d2a730ff
traceparent 00-b6770ad789a6b75790ee32cc9c1b43a4-dc422051dca15207-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-grpc--0916957d

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-d2a730ff,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-b6770ad789a6b75790ee32cc9c1b43a4-b996f88aaab05e1a-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--grpc-grpc--0916957d
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-bd14b267,team=alpha
ot-baggage-routing-key rk-bd14b267
traceparent 00-c410d7b305fbd6f402c6a410ec77c646-cc80494d085c4ccb-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-kafka--06299647

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--grpc-kafka--06299647
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-08aa9c0e,team=alpha
ot-baggage-routing-key rk-08aa9c0e
traceparent 00-3269931bbe29f43c31f03756f96dec16-313c0c4d33a0d463-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-rabbitmq--4bcfb337

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

baggage routing-key=rk-08aa9c0e,team=alpha
traceparent 00-3269931bbe29f43c31f03756f96dec16-3ae2d699d9332585-01
tracestate cptest=v1
test id
otel-python--grpc-rabbitmq--4bcfb337
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-68922656,team=alpha
ot-baggage-routing-key rk-68922656
traceparent 00-cf7ffac0daddc1fdf14719e70a8db58c-1e0088b01b3bc844-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-http--a30de564

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-c705f87f765ff95a641d1187e9cbd419-a92d37c0885aaf38-01
user-agent python-requests/2.34.2
test id
otel-python--kafka-http--a30de564
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-9364fac8,team=alpha
ot-baggage-routing-key rk-9364fac8
traceparent 00-59547584bd1d6dc4503ad6abd0482cfe-cf16103bf97c4ed5-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-grpc--8070e768

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-4632d240495514d41d104fbc2ef157a3-1eaf87c59e4bd9e6-01
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--kafka-grpc--8070e768
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-3b599926,team=alpha
ot-baggage-routing-key rk-3b599926
traceparent 00-88d82b5f640a44e9ef1a9870d5392722-2cc0219ccd6fce77-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-kafka--2c5e8ec7

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--kafka-kafka--2c5e8ec7
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-c6f60247,team=alpha
ot-baggage-routing-key rk-c6f60247
traceparent 00-3376c234ad1db737179dfbe22ae0dd33-25ef16822c96c955-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-rabbitmq--41209b19

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

traceparent 00-1680541adce996081b3ba2eb0fe97ac7-47d6837237c49b37-01
test id
otel-python--kafka-rabbitmq--41209b19
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-b64a316f,team=alpha
ot-baggage-routing-key rk-b64a316f
traceparent 00-d460d4c08ec40d93d18f1cfb1f95df1a-d58235c6161202dd-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-http--ca0e2325

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-b64a316f,team=alpha
connection keep-alive
content-length 51
content-type application/json
traceparent 00-d460d4c08ec40d93d18f1cfb1f95df1a-da67195a22c75a27-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--rabbitmq-http--ca0e2325
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-9eee8473,team=alpha
ot-baggage-routing-key rk-9eee8473
traceparent 00-5835cecc4788ea4e1a4cba66097dc8f6-c76fb385a943d05b-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-grpc--390352c8

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-9eee8473,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-5835cecc4788ea4e1a4cba66097dc8f6-a532a9f22c596c2d-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--rabbitmq-grpc--390352c8
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-e82bf19a,team=alpha
ot-baggage-routing-key rk-e82bf19a
traceparent 00-a5065a7f816cccc0c9fabea522b005f0-fed22f72044d7819-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-kafka--3062fc44

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--rabbitmq-kafka--3062fc44
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-7f94ade2,team=alpha
ot-baggage-routing-key rk-7f94ade2
traceparent 00-afdf2c8660dfe0782b047521b923a413-d67392fe1bb1682f-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-rabbitmq--950711a3

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

baggage routing-key=rk-7f94ade2,team=alpha
traceparent 00-afdf2c8660dfe0782b047521b923a413-b1085b080ec0f9ba-01
tracestate cptest=v1
test id
otel-python--rabbitmq-rabbitmq--950711a3
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent

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