otel-python

Python zero-code opentelemetry-distro0.49b1

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.49b1 0.49b1 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, 09:57 UTC
Harness
374f21d · measured in backtest-otel-python-0.49b1
Raw JSON
0.49b1.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-12c09c2e,team=alpha
ot-baggage-routing-key rk-12c09c2e
traceparent 00-f53ae1d0c85e754265870e320bde5dc1-6b36f3569ee67ce8-01
tracestate cptest=v1
x-cp-canary otel-python--http-http--302ac07f

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-12c09c2e,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-f53ae1d0c85e754265870e320bde5dc1-868276784b611302-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--http-http--302ac07f
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-339d83fc,team=alpha
ot-baggage-routing-key rk-339d83fc
traceparent 00-d6f567010097f27efab4765e4341800a-5055f9dfa7390bc7-01
tracestate cptest=v1
x-cp-canary otel-python--http-grpc--22241cb7

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-339d83fc,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-d6f567010097f27efab4765e4341800a-bf0808f22c341b03-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--http-grpc--22241cb7
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-55ca7754,team=alpha
ot-baggage-routing-key rk-55ca7754
traceparent 00-b65f08868e72a7584fcbd083141b7a87-1a6173bc9ebb7566-01
tracestate cptest=v1
x-cp-canary otel-python--http-kafka--f5645ec1

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--http-kafka--f5645ec1
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-27d015e1,team=alpha
ot-baggage-routing-key rk-27d015e1
traceparent 00-5490a053dcfbeace18dd463070d80446-4b481aa2e698c7a4-01
tracestate cptest=v1
x-cp-canary otel-python--http-rabbitmq--0baac8bd

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

baggage routing-key=rk-27d015e1,team=alpha
traceparent 00-5490a053dcfbeace18dd463070d80446-9417426a5055dfb3-01
tracestate cptest=v1
test id
otel-python--http-rabbitmq--0baac8bd
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-cce2d72a,team=alpha
ot-baggage-routing-key rk-cce2d72a
traceparent 00-44f9aa6011be5dbe78bf058b17b48b86-a0ffffb2f70c6b84-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-http--f2e4e48f

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-cce2d72a,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-44f9aa6011be5dbe78bf058b17b48b86-2bb368ace032d8e0-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--grpc-http--f2e4e48f
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-c1c86fd1,team=alpha
ot-baggage-routing-key rk-c1c86fd1
traceparent 00-f73cfe7e307bb508e2c8125711108d1f-404a93a7f65aba94-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-grpc--ac7510b3

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-c1c86fd1,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-f73cfe7e307bb508e2c8125711108d1f-a919a8d74992b17d-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--grpc-grpc--ac7510b3
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-f648ffbf,team=alpha
ot-baggage-routing-key rk-f648ffbf
traceparent 00-9fb0cd4f880e0882a1cfb7273d2de12b-5d03a6f29a332a45-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-kafka--628a780f

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--grpc-kafka--628a780f
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-71948f32,team=alpha
ot-baggage-routing-key rk-71948f32
traceparent 00-11b8cf3eaf0605d51d6359ada78e1d97-d1c9a07c96989b97-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-rabbitmq--27b33d52

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

baggage routing-key=rk-71948f32,team=alpha
traceparent 00-11b8cf3eaf0605d51d6359ada78e1d97-2b77b71483c1c322-01
tracestate cptest=v1
test id
otel-python--grpc-rabbitmq--27b33d52
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-b362aee5,team=alpha
ot-baggage-routing-key rk-b362aee5
traceparent 00-f54dcdd8fd4373ea40d0c57e7a1f7c84-4a480bf316cbb82a-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-http--7c6e48e4

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-6e700bfcee8a4aacd20de41088075385-0cb7a7b97b06eca4-01
user-agent python-requests/2.34.2
test id
otel-python--kafka-http--7c6e48e4
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-c4422a21,team=alpha
ot-baggage-routing-key rk-c4422a21
traceparent 00-cb07a4a9a49344d3b5a2f95f7a23dd37-81f9ff659111e1e2-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-grpc--b90ab1d2

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-879e2b472dce5c93c1787b051f647bdc-8d07faa4b40b0a73-01
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--kafka-grpc--b90ab1d2
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-11408d19,team=alpha
ot-baggage-routing-key rk-11408d19
traceparent 00-274279ccb3dc1f99e594ebfdfb85eecd-e665df76b5428c34-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-kafka--a3a03b2b

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--kafka-kafka--a3a03b2b
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-51d0a8be,team=alpha
ot-baggage-routing-key rk-51d0a8be
traceparent 00-c1aacaa6e12078331f61bf759b2ee3ad-44fd83af23600555-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-rabbitmq--5fc539fc

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

traceparent 00-47453a7b82a377d2fd3ac80e43aa99b5-f7f07ebdeae15e6d-01
test id
otel-python--kafka-rabbitmq--5fc539fc
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-09185bc5,team=alpha
ot-baggage-routing-key rk-09185bc5
traceparent 00-28e62590089d4366fbdce19026ab7ba0-4a03be699fc7b233-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-http--3f630c02

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-09185bc5,team=alpha
connection keep-alive
content-length 51
content-type application/json
traceparent 00-28e62590089d4366fbdce19026ab7ba0-62f9fe45a13c32ba-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--rabbitmq-http--3f630c02
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-e02a1b3a,team=alpha
ot-baggage-routing-key rk-e02a1b3a
traceparent 00-8be6b8bfbd6dc3f60368a0e9cd7841ec-061189b733964e20-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-grpc--bc8612e4

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-e02a1b3a,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-8be6b8bfbd6dc3f60368a0e9cd7841ec-ecfa115f1d59a899-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--rabbitmq-grpc--bc8612e4
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-2006f4e4,team=alpha
ot-baggage-routing-key rk-2006f4e4
traceparent 00-46a38a66026dc1678179a792b82bf7c5-bcf8a75db08ac236-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-kafka--25a3e04c

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--rabbitmq-kafka--25a3e04c
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-b5adf5e0,team=alpha
ot-baggage-routing-key rk-b5adf5e0
traceparent 00-0d7b528d5adeeb45b4f216daa30a789e-310b2b837b830c5e-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-rabbitmq--921f7e06

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

baggage routing-key=rk-b5adf5e0,team=alpha
traceparent 00-0d7b528d5adeeb45b4f216daa30a789e-38ef221a8e3c7fd1-01
tracestate cptest=v1
test id
otel-python--rabbitmq-rabbitmq--921f7e06
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent

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