elastic-python

Python init-only elastic-apm6.18.0

attach ElasticAPM(app) Flask middleware + instrument()

6/64 cells pass
  • Pass
  • Partial
  • New trace
  • Fail
  • Undelivered
  • Not run

Explanations

Elastic APM and New Relic have no OpenTracing-era ot-baggage-* propagation

by-design ot-baggage-* is a legacy OpenTracing convention; Elastic APM and New Relic each define their propagation header set without it and offer no option that adds it.

The seeded ot-baggage-routing-key header is neither extracted nor re-emitted by any Elastic or New Relic variant on any delivered boundary. Neither tool writes the OpenTracing header format: Elastic's agent spec defines traceparent, tracestate, baggage and the binary elasticapmtraceparent; New Relic's distributed-tracing model is traceparent, tracestate and the vendor newrelic header. Neither documents a setting that adds ot-baggage-*.

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). Where a tool propagates W3C baggage, the same values travel there instead.

16 cells affected

ot-baggage-not-implemented

Elastic Node, Python, Ruby and PHP agents do not propagate W3C baggage on any boundary

open Only Elastic's Java agent (and .NET over HTTP/gRPC) implements the baggage propagation the agent spec mandates; these agents drop it on every boundary.

Elastic's agent spec mandates baggage support, but only the Java agent delivers it end-to-end. elastic-apm-node 4.18.0 has no W3C baggage implementation; elastic-apm (Python) 6.26.2, elastic-apm (Ruby) 4.9.0 and elastic_apm (PHP) 1.17.0 measure baggage absent on every boundary, including http->http where traceparent/tracestate continue. The seeded member is neither extracted nor re-emitted.

Outside Java, Elastic APM cannot currently carry application baggage across protocol boundaries; a user must forward the baggage header as an application header themselves. Elastic's Node distributed-tracing docs likewise describe manual traceparent passing only (no tracestate or baggage). We found no upstream issue requesting W3C baggage in these agents.

16 cells affected

elastic-agents-no-w3c-baggage

elastic-apm Python: gRPC server interceptor assigns the tracestate header name instead of its value

open server_interceptor.py has `tracestate = metadata.key`, so after a gRPC hop the outbound tracestate is the literal string 'tracestate'; foreign entries are lost.

gRPC-inbound continues the trace (traceparent passes) but drops foreign tracestate entries: the outbound tracestate header emitted after a gRPC hop is the literal string tracestate. The root cause is a one-line bug in elasticapm/contrib/grpc/server_interceptor.py (v6.26.2, lines 66–73): elif metadata.key == "tracestate": tracestate = metadata.key. The header name is assigned instead of its value. Still unfixed on main (file last touched Oct 2023).

In the same package, the async variant (async_server_interceptor.py) never reads invocation_metadata at all, so the async gRPC server path does not extract trace context.

We found no upstream report of either; the fix for the first is one line (metadata.key → metadata.value). This is the only tracestate corruption observed among all tracers that continued a trace.

2 cells affected

elastic-python-grpc-tracestate-key-bug

elastic-apm Python has no confluent-kafka or pika instrumentation

open The Python agent's only messaging client is kafka-python; confluent-kafka and pika are uninstrumented: nothing is injected, consumers start no transaction.

The Python supported-technologies page lists kafka-python (>=2.0,<3) as its only messaging client; confluent-kafka and pika appear nowhere. On elastic-apm 6.26.2 nothing is injected into produced Kafka records or published AMQP messages, and consumers start no transaction, so even the outbound HTTP/gRPC calls after a consume carry no headers at all (absent, not a new trace).

RabbitMQ has been requested since Dec 2019 (#678: "It would be of high value to add instrumentation and distributed tracing for message brokers and, in particular, RabbitMQ"), still open. Workaround: start a transaction manually in the consumer with the received traceparent and inject headers manually on produce/publish.

24 cells affected

elastic-python-no-confluent-kafka-or-pika

Versions measured

Tracer
elastic-apm 6.18.0 6.18.0 on pypi github
Runtime
python 3.12.16
Setup tier
init-only A boot-file initializer loads and configures the tool before application code runs (Ruby's require+configure pattern, Elastic Python's middleware). Request-path code is untouched.
Attach
ElasticAPM(app) Flask middleware + instrument()
Relay source
relays/python
Ran at
10 Nov 2026, 07:46 UTC
Harness
9b99070 · measured in backtest-elastic-python-6.18.0
Raw JSON
6.18.0.json → variants[id = "elastic-python"]

Libraries

confluent-kafka2.15.0
flask3.1.3
grpcio1.83.1
rabbitmqpika 1.4.4
requests2.34.2

Configuration

Library defaults: no propagation-related environment set.

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-7c67f97a,team=alpha
ot-baggage-routing-key rk-7c67f97a
traceparent 00-cfeb94bd9d06cad735fe7a9e76946805-b41df630b295948b-01
tracestate cptest=v1
x-cp-canary elastic-python--http-http--0121f94d

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
connection keep-alive
content-length 50
content-type application/json
elastic-apm-traceparent 00-cfeb94bd9d06cad735fe7a9e76946805-bcccd5500641b3e1-01
traceparent 00-cfeb94bd9d06cad735fe7a9e76946805-bcccd5500641b3e1-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
elastic-python--http-http--0121f94d
raw statuses
baggage=absenttracestate=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-d465bffb,team=alpha
ot-baggage-routing-key rk-d465bffb
traceparent 00-74d7b0ae235094f86bd9506ff4c165b6-3756b39e70e9b81f-01
tracestate cptest=v1
x-cp-canary elastic-python--http-grpc--944121da

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-74d7b0ae235094f86bd9506ff4c165b6-78cfba570c6da6c6-01
tracestate cptest=v1
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
elastic-python--http-grpc--944121da
raw statuses
baggage=absenttracestate=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-31785e40,team=alpha
ot-baggage-routing-key rk-31785e40
traceparent 00-71308d7fcd12098949359ea730c81b0a-928aa1947ea0cd75-01
tracestate cptest=v1
x-cp-canary elastic-python--http-kafka--f2cceee0

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
elastic-python--http-kafka--f2cceee0
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-c10407fc,team=alpha
ot-baggage-routing-key rk-c10407fc
traceparent 00-9f970e98d97a32baf0fcc5b6bebd7761-f0c95c7086b45a03-01
tracestate cptest=v1
x-cp-canary elastic-python--http-rabbitmq--99b14dc7

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

No headers observed.

test id
elastic-python--http-rabbitmq--99b14dc7
raw statuses
baggage=absenttracestate=absenttraceparent=absentot_baggage=absent
gRPC HTTP baggage tracestate traceparent ot-baggage delivered via http

Seeded on the inbound gRPC metadata

baggage routing-key=rk-d65c6316,team=alpha
ot-baggage-routing-key rk-d65c6316
traceparent 00-b1f366515d6ed7cdc71f2d5acc2df1bc-0b784f3ada159ca0-01
tracestate cptest=v1
x-cp-canary elastic-python--grpc-http--de438d0e

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
connection keep-alive
content-length 50
content-type application/json
elastic-apm-traceparent 00-b1f366515d6ed7cdc71f2d5acc2df1bc-7395ff90ce837951-01
traceparent 00-b1f366515d6ed7cdc71f2d5acc2df1bc-7395ff90ce837951-01
tracestate tracestate
user-agent python-requests/2.34.2
test id
elastic-python--grpc-http--de438d0e
raw statuses
baggage=absenttracestate=present_entry_losttraceparent=same_traceot_baggage=absent
gRPC gRPC baggage tracestate traceparent ot-baggage delivered via grpc

Seeded on the inbound gRPC metadata

baggage routing-key=rk-fce90192,team=alpha
ot-baggage-routing-key rk-fce90192
traceparent 00-875127dd47e599939b7adff812fadfa2-99172e75be8fa130-01
tracestate cptest=v1
x-cp-canary elastic-python--grpc-grpc--b2208443

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-875127dd47e599939b7adff812fadfa2-73951dcfe9f932b9-01
tracestate tracestate
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
elastic-python--grpc-grpc--b2208443
raw statuses
baggage=absenttracestate=present_entry_losttraceparent=same_traceot_baggage=absent
gRPC Kafka baggage tracestate traceparent ot-baggage delivered via kafka

Seeded on the inbound gRPC metadata

baggage routing-key=rk-6ddfa6b7,team=alpha
ot-baggage-routing-key rk-6ddfa6b7
traceparent 00-7267f43929d8c6396d0d318451dc4d6d-29054bbd22897e48-01
tracestate cptest=v1
x-cp-canary elastic-python--grpc-kafka--699a3f92

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
elastic-python--grpc-kafka--699a3f92
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-29d7d70e,team=alpha
ot-baggage-routing-key rk-29d7d70e
traceparent 00-7fbd822c6744023298e280d55d61f58e-06159de8f65b843b-01
tracestate cptest=v1
x-cp-canary elastic-python--grpc-rabbitmq--f12282b5

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

No headers observed.

test id
elastic-python--grpc-rabbitmq--f12282b5
raw statuses
baggage=absenttracestate=absenttraceparent=absentot_baggage=absent
Kafka HTTP baggage tracestate traceparent ot-baggage delivered via http

Seeded on the inbound Kafka record headers

baggage routing-key=rk-46555846,team=alpha
ot-baggage-routing-key rk-46555846
traceparent 00-a594183a7ae18d31405f1b1579f4661f-c3f08dd1a27be952-01
tracestate cptest=v1
x-cp-canary elastic-python--kafka-http--1c57b74d

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
connection keep-alive
content-length 51
content-type application/json
user-agent python-requests/2.34.2
test id
elastic-python--kafka-http--1c57b74d
raw statuses
baggage=absenttracestate=absenttraceparent=absentot_baggage=absent
Kafka gRPC baggage tracestate traceparent ot-baggage delivered via grpc

Seeded on the inbound Kafka record headers

baggage routing-key=rk-483c2838,team=alpha
ot-baggage-routing-key rk-483c2838
traceparent 00-89be785685d56e881c3228ea0c3b4c44-a67cc969f39e4bda-01
tracestate cptest=v1
x-cp-canary elastic-python--kafka-grpc--923225a1

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
elastic-python--kafka-grpc--923225a1
raw statuses
baggage=absenttracestate=absenttraceparent=absentot_baggage=absent
Kafka Kafka baggage tracestate traceparent ot-baggage delivered via kafka

Seeded on the inbound Kafka record headers

baggage routing-key=rk-7b3739c4,team=alpha
ot-baggage-routing-key rk-7b3739c4
traceparent 00-72a3d629332ef2426754ee6cbfcc6dd9-c51dd8077b7e717b-01
tracestate cptest=v1
x-cp-canary elastic-python--kafka-kafka--4d2b18b0

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
elastic-python--kafka-kafka--4d2b18b0
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-59ceb1be,team=alpha
ot-baggage-routing-key rk-59ceb1be
traceparent 00-5ebbbdf16ac2ea565c2adba6bb964efd-bc2e4e29788f7fad-01
tracestate cptest=v1
x-cp-canary elastic-python--kafka-rabbitmq--c14b1696

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

No headers observed.

test id
elastic-python--kafka-rabbitmq--c14b1696
raw statuses
baggage=absenttracestate=absenttraceparent=absentot_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-990300d6,team=alpha
ot-baggage-routing-key rk-990300d6
traceparent 00-4f301c617f33f4e6b5fab59bdd0a74f5-ef56057f12c169a7-01
tracestate cptest=v1
x-cp-canary elastic-python--rabbitmq-http--8837b1ba

Observed at the sink on the outbound HTTP request headers

accept */*
accept-encoding gzip, deflate
connection keep-alive
content-length 54
content-type application/json
user-agent python-requests/2.34.2
test id
elastic-python--rabbitmq-http--8837b1ba
raw statuses
baggage=absenttracestate=absenttraceparent=absentot_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-5fc20c1a,team=alpha
ot-baggage-routing-key rk-5fc20c1a
traceparent 00-fcd38125f5462d70b017129bd1cde396-475000fdf3fd35ac-01
tracestate cptest=v1
x-cp-canary elastic-python--rabbitmq-grpc--391286d2

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
user-agent grpc-python/1.83.1 grpc-c/56.0.0 (linux; chttp2)
test id
elastic-python--rabbitmq-grpc--391286d2
raw statuses
baggage=absenttracestate=absenttraceparent=absentot_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-e5848abe,team=alpha
ot-baggage-routing-key rk-e5848abe
traceparent 00-064d424d4a5a32e16d729fa0d8313790-c3b130e114794c0d-01
tracestate cptest=v1
x-cp-canary elastic-python--rabbitmq-kafka--027675d9

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
elastic-python--rabbitmq-kafka--027675d9
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-dc9d7781,team=alpha
ot-baggage-routing-key rk-dc9d7781
traceparent 00-c61709f03e6b8bd317e042523ff4df55-c92e21ab75897d4a-01
tracestate cptest=v1
x-cp-canary elastic-python--rabbitmq-rabbitmq--d7185f88

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

No headers observed.

test id
elastic-python--rabbitmq-rabbitmq--d7185f88
raw statuses
baggage=absenttracestate=absenttraceparent=absentot_baggage=absent

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