otel-python

Python zero-code opentelemetry-distro0.66b0

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.66b0 0.66b0 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:40 UTC
Harness
9b99070 · measured in backtest-otel-python-0.66b0
Raw JSON
0.66b0.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-1562c656,team=alpha
ot-baggage-routing-key rk-1562c656
traceparent 00-5a175ebd0a18bf0476f93c1ddd323c64-9aa73f6c445b90fc-01
tracestate cptest=v1
x-cp-canary otel-python--http-http--68fc6531

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-1562c656,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-5a175ebd0a18bf0476f93c1ddd323c64-70b69d5a0c175f99-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--http-http--68fc6531
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-3bd61bcc,team=alpha
ot-baggage-routing-key rk-3bd61bcc
traceparent 00-354afd31e8f56c81d24f3dae9d91676e-8bff4a2627165ce2-01
tracestate cptest=v1
x-cp-canary otel-python--http-grpc--052d067e

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-3bd61bcc,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-354afd31e8f56c81d24f3dae9d91676e-a117f6a8d12ea823-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--http-grpc--052d067e
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-f6174060,team=alpha
ot-baggage-routing-key rk-f6174060
traceparent 00-2ece51aaacf4623f72cfb1ba70756d70-f480d92936246e40-01
tracestate cptest=v1
x-cp-canary otel-python--http-kafka--1abd3dfe

Observed at the sink on the outbound Kafka record headers

baggage routing-key=rk-f6174060,team=alpha
traceparent 00-2ece51aaacf4623f72cfb1ba70756d70-8bbf23996dc70a42-01
tracestate cptest=v1
test id
otel-python--http-kafka--1abd3dfe
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-65efb54a,team=alpha
ot-baggage-routing-key rk-65efb54a
traceparent 00-d6372e673ccceaec8b3e96df41ebb951-b9313718ec2dda3d-01
tracestate cptest=v1
x-cp-canary otel-python--http-rabbitmq--9594b5c3

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

baggage routing-key=rk-65efb54a,team=alpha
traceparent 00-d6372e673ccceaec8b3e96df41ebb951-28da831ea8c63ec0-01
tracestate cptest=v1
test id
otel-python--http-rabbitmq--9594b5c3
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-35a2da67,team=alpha
ot-baggage-routing-key rk-35a2da67
traceparent 00-6da04a7c6e66177e78c234fc59204e92-e1386c83666312fe-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-http--f548acb5

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-35a2da67,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-6da04a7c6e66177e78c234fc59204e92-97d2c1ec187b1703-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--grpc-http--f548acb5
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-febf8a82,team=alpha
ot-baggage-routing-key rk-febf8a82
traceparent 00-20248194b6eac421d4451b44cd5157e0-ef85ad7fc6e6ea49-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-grpc--266ef983

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-febf8a82,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-20248194b6eac421d4451b44cd5157e0-cb8d71c6050166d2-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--grpc-grpc--266ef983
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-c803296c,team=alpha
ot-baggage-routing-key rk-c803296c
traceparent 00-f29d11a4213902d499eee866fa8899ca-b749d3aeae258184-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-kafka--b3c238da

Observed at the sink on the outbound Kafka record headers

baggage routing-key=rk-c803296c,team=alpha
traceparent 00-f29d11a4213902d499eee866fa8899ca-10b84ab4ef01a412-01
tracestate cptest=v1
test id
otel-python--grpc-kafka--b3c238da
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-480b504c,team=alpha
ot-baggage-routing-key rk-480b504c
traceparent 00-420be8780aae9cef09ad13221351cbaf-b094f015f496271e-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-rabbitmq--d69862cf

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

baggage routing-key=rk-480b504c,team=alpha
traceparent 00-420be8780aae9cef09ad13221351cbaf-09bd329ae2ee51ef-01
tracestate cptest=v1
test id
otel-python--grpc-rabbitmq--d69862cf
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-2591c26b,team=alpha
ot-baggage-routing-key rk-2591c26b
traceparent 00-a01e72627879a1cd456d68c7e6c992d7-da470e7a6460677f-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-http--0f8503fe

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-9d8d57e06cb7eb4dc0acc23c892d013d-3c8060f845ea8f68-03
user-agent python-requests/2.34.2
test id
otel-python--kafka-http--0f8503fe
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-67719cd0,team=alpha
ot-baggage-routing-key rk-67719cd0
traceparent 00-3a83a823536eea4965c70538313cb1b7-9ad650a506cdc43e-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-grpc--066b47de

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-34466e63df37ff36661824c955e352d7-ef2f3195563e8b94-03
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--kafka-grpc--066b47de
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-ad574176,team=alpha
ot-baggage-routing-key rk-ad574176
traceparent 00-7be46b888d01f68ac9e67fa003f01884-b17cdf79c888d2af-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-kafka--412784af

Observed at the sink on the outbound Kafka record headers

traceparent 00-d8cd40964d8df498025e1e9e2dfb0328-345ccbb6b3dbbe21-03
test id
otel-python--kafka-kafka--412784af
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-76ba6778,team=alpha
ot-baggage-routing-key rk-76ba6778
traceparent 00-4a8b729d4b87b5119f3fdb22b50efbbc-a4c7b71edffb211b-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-rabbitmq--33b6b9d9

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

traceparent 00-c230024eddb849c8eb512a0045b544f6-3ae6d238c36c2823-03
test id
otel-python--kafka-rabbitmq--33b6b9d9
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-f727f0c8,team=alpha
ot-baggage-routing-key rk-f727f0c8
traceparent 00-00b51c5d9e8e11cbfc26a4929d82a12f-f052f440c278fa1b-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-http--5577b19f

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-f727f0c8,team=alpha
connection keep-alive
content-length 51
content-type application/json
traceparent 00-00b51c5d9e8e11cbfc26a4929d82a12f-6449719b25795cc5-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--rabbitmq-http--5577b19f
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-7c6e25f8,team=alpha
ot-baggage-routing-key rk-7c6e25f8
traceparent 00-de024149b157805c753abd637a3879f8-3bfd91904decd45c-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-grpc--1d42487a

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-7c6e25f8,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-de024149b157805c753abd637a3879f8-a5d7a20747f6cfeb-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--rabbitmq-grpc--1d42487a
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-e67247a0,team=alpha
ot-baggage-routing-key rk-e67247a0
traceparent 00-f9d10fefeed0a3f18ae1c8b03e966208-aa2d9124eca07067-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-kafka--7e653192

Observed at the sink on the outbound Kafka record headers

baggage routing-key=rk-e67247a0,team=alpha
traceparent 00-f9d10fefeed0a3f18ae1c8b03e966208-e61d0f5ad3fa7772-01
tracestate cptest=v1
test id
otel-python--rabbitmq-kafka--7e653192
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-5db9a880,team=alpha
ot-baggage-routing-key rk-5db9a880
traceparent 00-6f88dae9f7951a479d0e66edaca5ce7e-e34750eaf7cffc6a-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-rabbitmq--25eb21be

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

baggage routing-key=rk-5db9a880,team=alpha
traceparent 00-6f88dae9f7951a479d0e66edaca5ce7e-c1e58ecfc91edb19-01
tracestate cptest=v1
test id
otel-python--rabbitmq-rabbitmq--25eb21be
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent

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