otel-python

Python zero-code opentelemetry-distro0.58b0

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.58b0 0.58b0 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
9 Nov 2026, 19:56 UTC
Harness
9b99070 · measured in backtest-otel-python-0.58b0
Raw JSON
0.58b0.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-83b708aa,team=alpha
ot-baggage-routing-key rk-83b708aa
traceparent 00-23919522aa3b3bb7e7f1745ccc66b449-f5e9775687bf64a1-01
tracestate cptest=v1
x-cp-canary otel-python--http-http--6fc6d1be

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-83b708aa,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-23919522aa3b3bb7e7f1745ccc66b449-db7075c76ccedd72-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--http-http--6fc6d1be
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-05f18c34,team=alpha
ot-baggage-routing-key rk-05f18c34
traceparent 00-5869a3c41731f03bba6dd1215c46d198-b5cb11bc9ea893a7-01
tracestate cptest=v1
x-cp-canary otel-python--http-grpc--d4fc0d5a

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-05f18c34,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-5869a3c41731f03bba6dd1215c46d198-11b42b2104a0a0c9-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--http-grpc--d4fc0d5a
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-48ef113e,team=alpha
ot-baggage-routing-key rk-48ef113e
traceparent 00-acbd8a5d2ccb65bc3c10de920592edd2-365fc63ecfe47a7a-01
tracestate cptest=v1
x-cp-canary otel-python--http-kafka--9f13e07f

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--http-kafka--9f13e07f
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-22f9fc6d,team=alpha
ot-baggage-routing-key rk-22f9fc6d
traceparent 00-2783e0e5c9cc0d1055a5a5fc208d6a6b-5b3c293a5963b061-01
tracestate cptest=v1
x-cp-canary otel-python--http-rabbitmq--58e8dce3

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

baggage routing-key=rk-22f9fc6d,team=alpha
traceparent 00-2783e0e5c9cc0d1055a5a5fc208d6a6b-98c4f7c9fe50d81c-01
tracestate cptest=v1
test id
otel-python--http-rabbitmq--58e8dce3
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-ef83696c,team=alpha
ot-baggage-routing-key rk-ef83696c
traceparent 00-a672015f847cdeb4371821065c5a8b05-8230f99894ee05cf-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-http--b559fa85

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-ef83696c,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-a672015f847cdeb4371821065c5a8b05-0f5725f8103d9f49-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--grpc-http--b559fa85
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-d03f9a55,team=alpha
ot-baggage-routing-key rk-d03f9a55
traceparent 00-12c712f1156d8a22471f69e67beed9b4-a9dfc423fd14f393-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-grpc--13029bce

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-d03f9a55,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-12c712f1156d8a22471f69e67beed9b4-daa03d786ef8928a-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--grpc-grpc--13029bce
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-f0ec1a77,team=alpha
ot-baggage-routing-key rk-f0ec1a77
traceparent 00-d73d5c99a155c2a75cefb7dd51516400-014c51f360e7a398-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-kafka--3cdc8d77

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--grpc-kafka--3cdc8d77
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-7d86c0b4,team=alpha
ot-baggage-routing-key rk-7d86c0b4
traceparent 00-ab2eded5723a13673adad936064695be-fc4d750942730baa-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-rabbitmq--3a6e19c6

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

baggage routing-key=rk-7d86c0b4,team=alpha
traceparent 00-ab2eded5723a13673adad936064695be-c9c12a8f97527ca6-01
tracestate cptest=v1
test id
otel-python--grpc-rabbitmq--3a6e19c6
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-4f78b4e8,team=alpha
ot-baggage-routing-key rk-4f78b4e8
traceparent 00-1defbe8f212e6664e09b27d19023d615-26d009dcc0bcf2c3-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-http--d1446136

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-f162d33ae587621d5fd0ec07a4654cd7-255cae85870a2234-01
user-agent python-requests/2.34.2
test id
otel-python--kafka-http--d1446136
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-0ec9ffea,team=alpha
ot-baggage-routing-key rk-0ec9ffea
traceparent 00-3910881fcff7c993d962604f84f26bbc-08c9b436b0a88f6d-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-grpc--1d0b5c8e

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-78759cfd981fcb874d2ae19f9baed998-2d5effc8b1dd4835-01
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--kafka-grpc--1d0b5c8e
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-bd7155cf,team=alpha
ot-baggage-routing-key rk-bd7155cf
traceparent 00-eff1b4d79e6a2e2c1089693ab163693b-c1c1516e44e941e0-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-kafka--36c0ff22

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--kafka-kafka--36c0ff22
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-34e0cbc6,team=alpha
ot-baggage-routing-key rk-34e0cbc6
traceparent 00-3d3a53e0005f7b6d6c1fe4914c509206-e3644960e167a2b9-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-rabbitmq--2224b9a5

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

traceparent 00-8a7cb1d16b8a805438cb2f6033e9a4db-7b5fa315b574459a-01
test id
otel-python--kafka-rabbitmq--2224b9a5
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-9a0536d2,team=alpha
ot-baggage-routing-key rk-9a0536d2
traceparent 00-69cdb933f190428c8bc47ef8fc602c1d-16158111c7fc2fcb-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-http--f3f13b9e

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-9a0536d2,team=alpha
connection keep-alive
content-length 51
content-type application/json
traceparent 00-69cdb933f190428c8bc47ef8fc602c1d-87b26fb1606e8fae-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--rabbitmq-http--f3f13b9e
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-dce3fb80,team=alpha
ot-baggage-routing-key rk-dce3fb80
traceparent 00-183a780ee70521324d3c74b58dbf1fa9-c00f7c56f52ce7c6-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-grpc--27420d3b

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-dce3fb80,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-183a780ee70521324d3c74b58dbf1fa9-6b67d37189c36cd1-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--rabbitmq-grpc--27420d3b
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-abc3ffed,team=alpha
ot-baggage-routing-key rk-abc3ffed
traceparent 00-b3df3f487771ed2b0540f216921a25fc-5e791d9becbfc741-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-kafka--c3c42e0c

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--rabbitmq-kafka--c3c42e0c
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-d8772680,team=alpha
ot-baggage-routing-key rk-d8772680
traceparent 00-2227e83018f14d979f239c0d51103c0f-c876a223bf24e105-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-rabbitmq--b1a41ae0

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

baggage routing-key=rk-d8772680,team=alpha
traceparent 00-2227e83018f14d979f239c0d51103c0f-dd91a2a28ad84acc-01
tracestate cptest=v1
test id
otel-python--rabbitmq-rabbitmq--b1a41ae0
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent

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