otel-python

Python zero-code opentelemetry-distro0.50b0

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.50b0 0.50b0 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, 08:30 UTC
Harness
9b99070 · measured in backtest-otel-python-0.50b0
Raw JSON
0.50b0.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-f83fcd65,team=alpha
ot-baggage-routing-key rk-f83fcd65
traceparent 00-28ae04ece9f39132b07b042a4870f95f-b274bfc8bae55c2f-01
tracestate cptest=v1
x-cp-canary otel-python--http-http--b9d495fd

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-f83fcd65,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-28ae04ece9f39132b07b042a4870f95f-957bd72ee680da09-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--http-http--b9d495fd
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-e04916e3,team=alpha
ot-baggage-routing-key rk-e04916e3
traceparent 00-746bc5dd4cc85ea5ab8f7d058b139e0c-e7f95691884d1bce-01
tracestate cptest=v1
x-cp-canary otel-python--http-grpc--3df58f5b

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-e04916e3,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-746bc5dd4cc85ea5ab8f7d058b139e0c-defc8bf184f4deea-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--http-grpc--3df58f5b
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-1c9ae4a1,team=alpha
ot-baggage-routing-key rk-1c9ae4a1
traceparent 00-f4d08b17f20040f6ef0060134394e24c-4f91a7c5c48a43c6-01
tracestate cptest=v1
x-cp-canary otel-python--http-kafka--c6fa7953

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--http-kafka--c6fa7953
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-2bdb76ef,team=alpha
ot-baggage-routing-key rk-2bdb76ef
traceparent 00-eac269d4bfcab399190e793d238147b0-226ad399ed8bbb7b-01
tracestate cptest=v1
x-cp-canary otel-python--http-rabbitmq--3add64a7

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

baggage routing-key=rk-2bdb76ef,team=alpha
traceparent 00-eac269d4bfcab399190e793d238147b0-a3db01ad2d7f2939-01
tracestate cptest=v1
test id
otel-python--http-rabbitmq--3add64a7
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-a2f3f7ac,team=alpha
ot-baggage-routing-key rk-a2f3f7ac
traceparent 00-56f4f181c44f6f3fda1ae411114954cb-e5a18803894ece2b-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-http--38ec226b

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-a2f3f7ac,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-56f4f181c44f6f3fda1ae411114954cb-9c5106c5d524b3bc-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--grpc-http--38ec226b
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-f6789198,team=alpha
ot-baggage-routing-key rk-f6789198
traceparent 00-4ed59eca1f0998fb3b457a2f6a4f7515-2a0f4d72781672fd-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-grpc--4c27208a

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-f6789198,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-4ed59eca1f0998fb3b457a2f6a4f7515-bb689770ac3c3ae1-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--grpc-grpc--4c27208a
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-ce39a08b,team=alpha
ot-baggage-routing-key rk-ce39a08b
traceparent 00-1ecb1e9163d6b193c80f48eeba07325c-6fd456a604fa5e72-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-kafka--12ee05d1

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--grpc-kafka--12ee05d1
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-963d436d,team=alpha
ot-baggage-routing-key rk-963d436d
traceparent 00-1e3be10c0c0f6c91fb3c43336e245d48-03b4bc1cb3725d0d-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-rabbitmq--34a334f2

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

baggage routing-key=rk-963d436d,team=alpha
traceparent 00-1e3be10c0c0f6c91fb3c43336e245d48-f16cf6a1341b86b4-01
tracestate cptest=v1
test id
otel-python--grpc-rabbitmq--34a334f2
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-b183eef8,team=alpha
ot-baggage-routing-key rk-b183eef8
traceparent 00-954ee3acfc76df1a790d260d28955f3a-04d98ae87ae223e2-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-http--eee0b46f

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-063cc83d236221a8f5c580d5ef0b2493-c1bfcbaee3753661-01
user-agent python-requests/2.34.2
test id
otel-python--kafka-http--eee0b46f
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-e004c4f4,team=alpha
ot-baggage-routing-key rk-e004c4f4
traceparent 00-5084b730b942f1a4a4dc53c446a30c4c-74d5f27f63870226-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-grpc--ddd8a674

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-46acd2bbdbaf8a714fe548721a7273a9-b56e1e8232a331c4-01
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--kafka-grpc--ddd8a674
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-08ea8494,team=alpha
ot-baggage-routing-key rk-08ea8494
traceparent 00-c5b5138540c5f26ec306fe4e069d997d-1b95875fac781da6-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-kafka--f4ddbbd2

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--kafka-kafka--f4ddbbd2
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-cacd7f15,team=alpha
ot-baggage-routing-key rk-cacd7f15
traceparent 00-ca5dddb699eae9313f6b0cc2d3ab8cf9-c6837443feb0c48e-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-rabbitmq--7ab9e5c6

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

traceparent 00-68ec363945e0e86fab33cdca9d1308eb-f22df974f642b29a-01
test id
otel-python--kafka-rabbitmq--7ab9e5c6
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-abe725f8,team=alpha
ot-baggage-routing-key rk-abe725f8
traceparent 00-ca89e6847c8bab29e98a23684f82a339-38727a7418480c4c-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-http--af0533a0

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-abe725f8,team=alpha
connection keep-alive
content-length 51
content-type application/json
traceparent 00-ca89e6847c8bab29e98a23684f82a339-18bd0a0881828058-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--rabbitmq-http--af0533a0
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-8d344e4f,team=alpha
ot-baggage-routing-key rk-8d344e4f
traceparent 00-3092301076b2c2ee07b833c22554532a-68bf7b8618912d7c-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-grpc--2146b1e7

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-8d344e4f,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-3092301076b2c2ee07b833c22554532a-2b06263486bb7966-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--rabbitmq-grpc--2146b1e7
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-74bd05eb,team=alpha
ot-baggage-routing-key rk-74bd05eb
traceparent 00-3298bdbe4b849452953e73833a5d447d-749c9ba022ec364c-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-kafka--b42be3a8

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--rabbitmq-kafka--b42be3a8
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-b41b9e41,team=alpha
ot-baggage-routing-key rk-b41b9e41
traceparent 00-b8a53bcbe5f5a97128777c323b277fa0-9f2503f84ea94765-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-rabbitmq--bea5126f

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

baggage routing-key=rk-b41b9e41,team=alpha
traceparent 00-b8a53bcbe5f5a97128777c323b277fa0-01fbbd243657ec4a-01
tracestate cptest=v1
test id
otel-python--rabbitmq-rabbitmq--bea5126f
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent

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