otel-python

Python zero-code opentelemetry-distro0.52b1

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.52b1 0.52b1 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:21 UTC
Harness
9b99070 · measured in backtest-otel-python-0.52b1
Raw JSON
0.52b1.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-d1526805,team=alpha
ot-baggage-routing-key rk-d1526805
traceparent 00-b342bf5736eb1394f69afa63a4dac7a0-3bd64ba65acfbca4-01
tracestate cptest=v1
x-cp-canary otel-python--http-http--ab0869b7

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-d1526805,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-b342bf5736eb1394f69afa63a4dac7a0-45375f27a4c9a9da-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--http-http--ab0869b7
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-ebf26b15,team=alpha
ot-baggage-routing-key rk-ebf26b15
traceparent 00-f74b13bc06ae3288e4bf4919cca9ef7e-b9a6cd41be14e4b6-01
tracestate cptest=v1
x-cp-canary otel-python--http-grpc--14380c39

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-ebf26b15,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-f74b13bc06ae3288e4bf4919cca9ef7e-6054f9773873fdde-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--http-grpc--14380c39
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-bc98af1b,team=alpha
ot-baggage-routing-key rk-bc98af1b
traceparent 00-2f12b622f15af1712720c575d062a1b2-54d08edbe85501c5-01
tracestate cptest=v1
x-cp-canary otel-python--http-kafka--81871cba

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--http-kafka--81871cba
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-dd05c584,team=alpha
ot-baggage-routing-key rk-dd05c584
traceparent 00-88022e3c45b8ab6bab13cc6a1829c0e1-ddb0dc47ef575269-01
tracestate cptest=v1
x-cp-canary otel-python--http-rabbitmq--f2eb7946

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

baggage routing-key=rk-dd05c584,team=alpha
traceparent 00-88022e3c45b8ab6bab13cc6a1829c0e1-05f0b58f525cd866-01
tracestate cptest=v1
test id
otel-python--http-rabbitmq--f2eb7946
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-f6f48d8c,team=alpha
ot-baggage-routing-key rk-f6f48d8c
traceparent 00-0458badf563bb064b5f4f5d32147bc55-ef1ea25a6aca43fb-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-http--e4abe76b

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-f6f48d8c,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-0458badf563bb064b5f4f5d32147bc55-caec8c13eb0e1426-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--grpc-http--e4abe76b
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-7b38adee,team=alpha
ot-baggage-routing-key rk-7b38adee
traceparent 00-01c8d124e7c3e745476d36ed274b4799-60be36c238d68702-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-grpc--c6876087

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-7b38adee,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-01c8d124e7c3e745476d36ed274b4799-ca743d9bd7a08a11-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--grpc-grpc--c6876087
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-8b267de2,team=alpha
ot-baggage-routing-key rk-8b267de2
traceparent 00-931bb3a06f0a105ed5f02a3d93aac340-89957e0008ecc46d-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-kafka--d96cf56f

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--grpc-kafka--d96cf56f
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-cf4f4582,team=alpha
ot-baggage-routing-key rk-cf4f4582
traceparent 00-d12057fd5914c25718c4f822809694d0-6a45d2167896c475-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-rabbitmq--8e704d3c

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

baggage routing-key=rk-cf4f4582,team=alpha
traceparent 00-d12057fd5914c25718c4f822809694d0-636ac2e0a5c16c57-01
tracestate cptest=v1
test id
otel-python--grpc-rabbitmq--8e704d3c
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-b6ec0744,team=alpha
ot-baggage-routing-key rk-b6ec0744
traceparent 00-f9ad90081036609e9adf4446ce390174-7f45a9fa4bd1bf8a-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-http--29812980

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-b1504bbe5e799286f69ed3394f552848-474e45fd90d52fb4-01
user-agent python-requests/2.34.2
test id
otel-python--kafka-http--29812980
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-3c798b1b,team=alpha
ot-baggage-routing-key rk-3c798b1b
traceparent 00-fdad40444f81e5db54b5dfc4e3a6d036-00b02762ad6d3335-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-grpc--48876887

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-82808649d3693d369ac341d471c5d837-96aec3ed3dd2fd42-01
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--kafka-grpc--48876887
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-b514499c,team=alpha
ot-baggage-routing-key rk-b514499c
traceparent 00-3aa1aab14e9aca91aa3f97b926576b15-990693b58cd5c4fc-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-kafka--3cce3135

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--kafka-kafka--3cce3135
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-d5177581,team=alpha
ot-baggage-routing-key rk-d5177581
traceparent 00-f6cfa037f9dcf5e5aa4e7976709cb892-f9dba2ad7575f3d1-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-rabbitmq--b8561518

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

traceparent 00-f5b991cdbc45b8626ec92ade8a367824-4a0acd5daef83847-01
test id
otel-python--kafka-rabbitmq--b8561518
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-0352c56b,team=alpha
ot-baggage-routing-key rk-0352c56b
traceparent 00-1ef79422aec035f72ca5a28846012d8d-5aa969459e985ff6-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-http--65634897

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-0352c56b,team=alpha
connection keep-alive
content-length 51
content-type application/json
traceparent 00-1ef79422aec035f72ca5a28846012d8d-71874649a8858660-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--rabbitmq-http--65634897
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-9e8cf86e,team=alpha
ot-baggage-routing-key rk-9e8cf86e
traceparent 00-41a5fef7bac26803ea65f4307877b1f2-aa1da9026d933296-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-grpc--e9cfe603

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-9e8cf86e,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-41a5fef7bac26803ea65f4307877b1f2-90ae577e055e38d3-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--rabbitmq-grpc--e9cfe603
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-552807c6,team=alpha
ot-baggage-routing-key rk-552807c6
traceparent 00-552cdb8fe7d3fb3cd2c7d618b1a2fe40-26bc928325b38668-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-kafka--d0435856

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--rabbitmq-kafka--d0435856
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-d2fd4bfb,team=alpha
ot-baggage-routing-key rk-d2fd4bfb
traceparent 00-22885bbd73ab27c4b0f1744589e477cb-acc934ad0fed5dcf-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-rabbitmq--a6789f7f

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

baggage routing-key=rk-d2fd4bfb,team=alpha
traceparent 00-22885bbd73ab27c4b0f1744589e477cb-da09f269d2f8086a-01
tracestate cptest=v1
test id
otel-python--rabbitmq-rabbitmq--a6789f7f
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent

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