otel-python

Python zero-code opentelemetry-distro0.63b1

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.63b1 0.63b1 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.63b1
Raw JSON
0.63b1.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-a7b8ae22,team=alpha
ot-baggage-routing-key rk-a7b8ae22
traceparent 00-9f8868c9e9840d89e0a0ea517d99b968-e56420a146eaef39-01
tracestate cptest=v1
x-cp-canary otel-python--http-http--058ee7c0

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-a7b8ae22,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-9f8868c9e9840d89e0a0ea517d99b968-f7464afb0ca4771a-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--http-http--058ee7c0
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-7f06fb8c,team=alpha
ot-baggage-routing-key rk-7f06fb8c
traceparent 00-b010480da2c83e2adbe5b9a61c15b357-086968a154fcfd57-01
tracestate cptest=v1
x-cp-canary otel-python--http-grpc--2045bf4e

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-7f06fb8c,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-b010480da2c83e2adbe5b9a61c15b357-25521c9f5eab306f-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--http-grpc--2045bf4e
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-25fbfcd8,team=alpha
ot-baggage-routing-key rk-25fbfcd8
traceparent 00-b53ca0861da00e3dc9f870af9acb09bf-8258f60208966a61-01
tracestate cptest=v1
x-cp-canary otel-python--http-kafka--a04e9652

Observed at the sink on the outbound Kafka record headers

baggage routing-key=rk-25fbfcd8,team=alpha
traceparent 00-b53ca0861da00e3dc9f870af9acb09bf-d1c4bdfb0ab17dc4-01
tracestate cptest=v1
test id
otel-python--http-kafka--a04e9652
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-2073d942,team=alpha
ot-baggage-routing-key rk-2073d942
traceparent 00-a9f64f7b6fc00984058209434fe111b8-2f92440e0746d928-01
tracestate cptest=v1
x-cp-canary otel-python--http-rabbitmq--1629b8f8

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

baggage routing-key=rk-2073d942,team=alpha
traceparent 00-a9f64f7b6fc00984058209434fe111b8-b81d69e92dcad05e-01
tracestate cptest=v1
test id
otel-python--http-rabbitmq--1629b8f8
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-c16018a9,team=alpha
ot-baggage-routing-key rk-c16018a9
traceparent 00-227a86cc479c047dcb07434c997e9aa2-472ce51414332ee8-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-http--60a03850

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-c16018a9,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-227a86cc479c047dcb07434c997e9aa2-b11267b8f072e893-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--grpc-http--60a03850
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-c675fabb,team=alpha
ot-baggage-routing-key rk-c675fabb
traceparent 00-f8ddb740b01a94fcf71b887d9f61e510-9f38c8861f69ed89-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-grpc--1ee15a5e

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-c675fabb,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-f8ddb740b01a94fcf71b887d9f61e510-575f37876719918e-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--grpc-grpc--1ee15a5e
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-578eefc3,team=alpha
ot-baggage-routing-key rk-578eefc3
traceparent 00-88e6a947d171bcccf5825d98dd244118-12e8a2b11122e5b4-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-kafka--39dcd623

Observed at the sink on the outbound Kafka record headers

baggage routing-key=rk-578eefc3,team=alpha
traceparent 00-88e6a947d171bcccf5825d98dd244118-3ffbae877b9aef3c-01
tracestate cptest=v1
test id
otel-python--grpc-kafka--39dcd623
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-d5e2e6fe,team=alpha
ot-baggage-routing-key rk-d5e2e6fe
traceparent 00-5ed06d57c9d973ddb73240a6df8aaca8-8d5550ac1a65bf64-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-rabbitmq--ffd59aa6

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

baggage routing-key=rk-d5e2e6fe,team=alpha
traceparent 00-5ed06d57c9d973ddb73240a6df8aaca8-f311ca2caf3c50db-01
tracestate cptest=v1
test id
otel-python--grpc-rabbitmq--ffd59aa6
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-941943f0,team=alpha
ot-baggage-routing-key rk-941943f0
traceparent 00-97a6d7d778392d6aca5b203af0df7d30-b39c3e4cf5fb0115-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-http--3ec8de10

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-0bc46e31855d8c2221bb61aa0cbda5c7-ea3aa5b55a0c8aee-03
user-agent python-requests/2.34.2
test id
otel-python--kafka-http--3ec8de10
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-7dfbebe4,team=alpha
ot-baggage-routing-key rk-7dfbebe4
traceparent 00-80e7109c11e417c42dfdc684af35112c-539fb64999dfd090-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-grpc--aa2e8511

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-b31449067edf0175219f4ea3673a694a-1efe9f065f660c24-03
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--kafka-grpc--aa2e8511
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-62167e0a,team=alpha
ot-baggage-routing-key rk-62167e0a
traceparent 00-5f6d9f3c819be04cacec4d701994fd54-df7f962374e3d601-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-kafka--5ce97fe4

Observed at the sink on the outbound Kafka record headers

traceparent 00-930a8f425682d9718cf05b373daad6b0-406d892f3d703e5a-03
test id
otel-python--kafka-kafka--5ce97fe4
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-ec00973b,team=alpha
ot-baggage-routing-key rk-ec00973b
traceparent 00-3bd821b355cea5ef52a056c897a11d9f-9e9b0441f73c85b3-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-rabbitmq--31c58d25

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

traceparent 00-803e2c2cd8422f91ca22034d8447d72b-6fef96fa6771941e-03
test id
otel-python--kafka-rabbitmq--31c58d25
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-384a9f8e,team=alpha
ot-baggage-routing-key rk-384a9f8e
traceparent 00-fbec910fe46389fdc782e19e4cb35f88-fc14f50a017f1809-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-http--7227fc43

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-384a9f8e,team=alpha
connection keep-alive
content-length 51
content-type application/json
traceparent 00-fbec910fe46389fdc782e19e4cb35f88-b30f1429be76b962-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--rabbitmq-http--7227fc43
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-2407795c,team=alpha
ot-baggage-routing-key rk-2407795c
traceparent 00-d949b839625ffd40635e28c8139c52c0-ce78c0a2e1bdceeb-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-grpc--313b99b4

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-2407795c,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-d949b839625ffd40635e28c8139c52c0-ad2bd8dcbafb0a38-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--rabbitmq-grpc--313b99b4
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-2827a5b1,team=alpha
ot-baggage-routing-key rk-2827a5b1
traceparent 00-0a1a8a9540c0117ca4f377ae0ee374f8-b851316afbf01c00-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-kafka--83bfe680

Observed at the sink on the outbound Kafka record headers

baggage routing-key=rk-2827a5b1,team=alpha
traceparent 00-0a1a8a9540c0117ca4f377ae0ee374f8-f4840022c7472fb6-01
tracestate cptest=v1
test id
otel-python--rabbitmq-kafka--83bfe680
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-1344f704,team=alpha
ot-baggage-routing-key rk-1344f704
traceparent 00-98abaf03882a845b64d8db28bd7376bb-8ce499a567858e83-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-rabbitmq--3b0d13d5

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

baggage routing-key=rk-1344f704,team=alpha
traceparent 00-98abaf03882a845b64d8db28bd7376bb-20300ae29886126b-01
tracestate cptest=v1
test id
otel-python--rabbitmq-rabbitmq--3b0d13d5
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent

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