otel-python

Python zero-code opentelemetry-distro0.49b0

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.49b0 0.49b0 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:59 UTC
Harness
374f21d · measured in backtest-otel-python-0.49b0
Raw JSON
0.49b0.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-59ead0b4,team=alpha
ot-baggage-routing-key rk-59ead0b4
traceparent 00-10562a884013129aa8f3c811e7593f58-5ca0ad7a5c895a13-01
tracestate cptest=v1
x-cp-canary otel-python--http-http--749aaba8

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-59ead0b4,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-10562a884013129aa8f3c811e7593f58-30d04ece5bbaa1fe-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--http-http--749aaba8
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-77a256f6,team=alpha
ot-baggage-routing-key rk-77a256f6
traceparent 00-153e2ee63c5fdd23dd1af4418279f23b-35e4fb41d28a2fe9-01
tracestate cptest=v1
x-cp-canary otel-python--http-grpc--dc1048b2

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-77a256f6,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-153e2ee63c5fdd23dd1af4418279f23b-8e95f800d96fe8ae-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--http-grpc--dc1048b2
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-39d9d277,team=alpha
ot-baggage-routing-key rk-39d9d277
traceparent 00-6e4d9135c83bac228e3ba3d4c8dcaad6-aaa49c404d291cc2-01
tracestate cptest=v1
x-cp-canary otel-python--http-kafka--1818f553

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--http-kafka--1818f553
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-9e3d3fee,team=alpha
ot-baggage-routing-key rk-9e3d3fee
traceparent 00-bd1924be50e3d00e811a8bd4516b41ec-6ebea1dca01357e6-01
tracestate cptest=v1
x-cp-canary otel-python--http-rabbitmq--f3088244

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

baggage routing-key=rk-9e3d3fee,team=alpha
traceparent 00-bd1924be50e3d00e811a8bd4516b41ec-9c22eb42ba472006-01
tracestate cptest=v1
test id
otel-python--http-rabbitmq--f3088244
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-7037f40d,team=alpha
ot-baggage-routing-key rk-7037f40d
traceparent 00-97f6cfb61b16d14db057d490c1137aec-53bb5671e34e1464-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-http--18f0a666

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-7037f40d,team=alpha
connection keep-alive
content-length 47
content-type application/json
traceparent 00-97f6cfb61b16d14db057d490c1137aec-42adffc01b07d1b9-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--grpc-http--18f0a666
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-99eaff39,team=alpha
ot-baggage-routing-key rk-99eaff39
traceparent 00-3941088c31c27c0385f38fa01255d493-2713a82c9b8fab7b-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-grpc--e02f0e6a

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-99eaff39,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-3941088c31c27c0385f38fa01255d493-86e12e0db5492b5b-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--grpc-grpc--e02f0e6a
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-646b2e88,team=alpha
ot-baggage-routing-key rk-646b2e88
traceparent 00-3d9c6c7449ea4ba4149f4a0ce7ff9d52-c454d9ca9ea87015-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-kafka--6b514925

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--grpc-kafka--6b514925
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-a352b54c,team=alpha
ot-baggage-routing-key rk-a352b54c
traceparent 00-d5a11e4b7c6b5cee18b60d56ed8f5c82-e9d85d703bd76454-01
tracestate cptest=v1
x-cp-canary otel-python--grpc-rabbitmq--d3aff72f

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

baggage routing-key=rk-a352b54c,team=alpha
traceparent 00-d5a11e4b7c6b5cee18b60d56ed8f5c82-7570b3e871c24033-01
tracestate cptest=v1
test id
otel-python--grpc-rabbitmq--d3aff72f
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-b0622961,team=alpha
ot-baggage-routing-key rk-b0622961
traceparent 00-0fdc167a2b6be01bb73bda41c636010d-17e346bce94fbbb7-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-http--867d62e1

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-c35ca6fe8566dc21a96e8e2f451f15a5-374ca50868fcf17b-01
user-agent python-requests/2.34.2
test id
otel-python--kafka-http--867d62e1
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-337cdb33,team=alpha
ot-baggage-routing-key rk-337cdb33
traceparent 00-74d7eb1fabfd67a50938afa3af6e813e-8ca168a33cc8af35-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-grpc--c04b6f1a

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-32e97c88bfb2f0993342ea9f079c17d4-adc6b95b15a05abd-01
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--kafka-grpc--c04b6f1a
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-289377df,team=alpha
ot-baggage-routing-key rk-289377df
traceparent 00-5060cea6dcbd9100f9a0bf099d5d6721-bbaaedd2ab1febbe-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-kafka--a95b5710

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--kafka-kafka--a95b5710
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-44235b73,team=alpha
ot-baggage-routing-key rk-44235b73
traceparent 00-7128f82dfd5ac9176f384692c92cf477-22451f03692159d9-01
tracestate cptest=v1
x-cp-canary otel-python--kafka-rabbitmq--2c41efb9

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

traceparent 00-b6f6b2b49e01d81172d090125883ab26-a6d16423e15ef126-01
test id
otel-python--kafka-rabbitmq--2c41efb9
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-cef4ec43,team=alpha
ot-baggage-routing-key rk-cef4ec43
traceparent 00-4ecbc9e1a5c1e140b65cd54c9bfb4301-114fb0d3145300ed-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-http--17e694f7

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
baggage routing-key=rk-cef4ec43,team=alpha
connection keep-alive
content-length 51
content-type application/json
traceparent 00-4ecbc9e1a5c1e140b65cd54c9bfb4301-33cd19b256ca47c6-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
otel-python--rabbitmq-http--17e694f7
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-45b75f2a,team=alpha
ot-baggage-routing-key rk-45b75f2a
traceparent 00-df592225b6197fab892beb28e07c154a-5726b90608ee9cf2-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-grpc--6ef3afd7

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
baggage routing-key=rk-45b75f2a,team=alpha
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-df592225b6197fab892beb28e07c154a-6c86d080f6e380ca-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
otel-python--rabbitmq-grpc--6ef3afd7
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-f66cec7a,team=alpha
ot-baggage-routing-key rk-f66cec7a
traceparent 00-a9dca546446378c1b941f1659ad312e1-00c27c01d8aba7a0-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-kafka--5d24ec90

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-python--rabbitmq-kafka--5d24ec90
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-fd8685c3,team=alpha
ot-baggage-routing-key rk-fd8685c3
traceparent 00-707754dba0e9df82112c42f5687d186f-f317150872e7ba79-01
tracestate cptest=v1
x-cp-canary otel-python--rabbitmq-rabbitmq--c4e059dd

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

baggage routing-key=rk-fd8685c3,team=alpha
traceparent 00-707754dba0e9df82112c42f5687d186f-0fc1ff387bec2be9-01
tracestate cptest=v1
test id
otel-python--rabbitmq-rabbitmq--c4e059dd
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent

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