elastic-python

Python init-only elastic-apm6.26.2

attach python boot_elastic.py (instrument() + ElasticAPM(app) Flask middleware)

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.26.2 6.26.2 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
python boot_elastic.py (instrument() + ElasticAPM(app) Flask middleware)
Relay source
relays/python
Ran at
16 Nov 2026, 17:49 UTC
Harness
e6da193 · measured in run-2026-11-16.6
Raw JSON
6.26.2.json → variants[id = "elastic-python"]

Libraries

confluent-kafka2.16.1
flask3.1.3
grpcio1.85.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 native: present_same_trace

Seeded on the inbound HTTP request headers

baggage routing-key=rk-e96a4164,team=alpha
ot-baggage-routing-key rk-e96a4164
traceparent 00-3d44d2350e9a93a7e9f4338d1e01b9a5-9dba7117888f747b-01
tracestate cptest=v1
x-cp-canary elastic-python--http-http--220dcbec

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-3d44d2350e9a93a7e9f4338d1e01b9a5-be3f42df9ee94b55-01
traceparent 00-3d44d2350e9a93a7e9f4338d1e01b9a5-be3f42df9ee94b55-01
tracestate cptest=v1
user-agent python-requests/2.34.2
test id
elastic-python--http-http--220dcbec
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-d2053128,team=alpha
ot-baggage-routing-key rk-d2053128
traceparent 00-c06fd01f75a661933738bf1715597153-98d7a8d71db751b4-01
tracestate cptest=v1
x-cp-canary elastic-python--http-grpc--7b392774

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-c06fd01f75a661933738bf1715597153-62b35711904e53db-01
tracestate cptest=v1
user-agent grpc-python/1.85.1 grpc-c/58.0.0 (linux; chttp2)
test id
elastic-python--http-grpc--7b392774
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-5cdc4ce9,team=alpha
ot-baggage-routing-key rk-5cdc4ce9
traceparent 00-987fd3454d2049f7e06d5d148f70cebf-707ec35c72da6b04-01
tracestate cptest=v1
x-cp-canary elastic-python--http-kafka--fbbeb1bd

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
elastic-python--http-kafka--fbbeb1bd
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-12aa38da,team=alpha
ot-baggage-routing-key rk-12aa38da
traceparent 00-b8141a9b3247d483a9ddbdfcbb9ef6b3-5028b83a3cb12ccf-01
tracestate cptest=v1
x-cp-canary elastic-python--http-rabbitmq--ce2e850a

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

No headers observed.

test id
elastic-python--http-rabbitmq--ce2e850a
raw statuses
baggage=absenttracestate=absenttraceparent=absentot_baggage=absent
gRPC HTTP baggage tracestate traceparent ot-baggage delivered via http native: present_same_trace

Seeded on the inbound gRPC metadata

baggage routing-key=rk-1bb33aef,team=alpha
ot-baggage-routing-key rk-1bb33aef
traceparent 00-24f961862fad99a69cbc85fb4758156a-3eff57cb61154aa0-01
tracestate cptest=v1
x-cp-canary elastic-python--grpc-http--4b59499d

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-24f961862fad99a69cbc85fb4758156a-d00fbc0e175f6cc6-01
traceparent 00-24f961862fad99a69cbc85fb4758156a-d00fbc0e175f6cc6-01
tracestate tracestate
user-agent python-requests/2.34.2
test id
elastic-python--grpc-http--4b59499d
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-cc4ffcb6,team=alpha
ot-baggage-routing-key rk-cc4ffcb6
traceparent 00-e5d07eea838feaeb9ca1175eb3056885-ecfb3bb75c783ece-01
tracestate cptest=v1
x-cp-canary elastic-python--grpc-grpc--1768a36c

Observed at the sink on the outbound gRPC metadata

:authority sink:9081
content-type application/grpc
grpc-accept-encoding identity, deflate, gzip
traceparent 00-e5d07eea838feaeb9ca1175eb3056885-018092c533d8d930-01
tracestate tracestate
user-agent grpc-python/1.85.1 grpc-c/58.0.0 (linux; chttp2)
test id
elastic-python--grpc-grpc--1768a36c
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-61db6777,team=alpha
ot-baggage-routing-key rk-61db6777
traceparent 00-59567f2b7abad76b503931cfff057aad-0a00635abb7555b1-01
tracestate cptest=v1
x-cp-canary elastic-python--grpc-kafka--f1093b4a

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
elastic-python--grpc-kafka--f1093b4a
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-9632951e,team=alpha
ot-baggage-routing-key rk-9632951e
traceparent 00-73a15cd45bb1a149c08d5e22e9542da0-398a56e15a50e484-01
tracestate cptest=v1
x-cp-canary elastic-python--grpc-rabbitmq--ff40fb93

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

No headers observed.

test id
elastic-python--grpc-rabbitmq--ff40fb93
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-452286c7,team=alpha
ot-baggage-routing-key rk-452286c7
traceparent 00-76caf2928ff202ae78aecae0e3cf3fae-777ae6916efc87bc-01
tracestate cptest=v1
x-cp-canary elastic-python--kafka-http--aa84de01

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--aa84de01
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-f9c805bf,team=alpha
ot-baggage-routing-key rk-f9c805bf
traceparent 00-62ca7cf691861855185d4e95c25de985-1943447fd4d1d688-01
tracestate cptest=v1
x-cp-canary elastic-python--kafka-grpc--0da5087b

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.85.1 grpc-c/58.0.0 (linux; chttp2)
test id
elastic-python--kafka-grpc--0da5087b
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-ca109c77,team=alpha
ot-baggage-routing-key rk-ca109c77
traceparent 00-61722ddae5eaf4475fc6b8ee0730f0c5-c2f3e34b6de0dea3-01
tracestate cptest=v1
x-cp-canary elastic-python--kafka-kafka--6fbd2430

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
elastic-python--kafka-kafka--6fbd2430
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-f34e4144,team=alpha
ot-baggage-routing-key rk-f34e4144
traceparent 00-e0d79058b7013bcb4ecb65b82347b9d1-3e7950cadd69af22-01
tracestate cptest=v1
x-cp-canary elastic-python--kafka-rabbitmq--f2566ee9

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

No headers observed.

test id
elastic-python--kafka-rabbitmq--f2566ee9
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-2c46bd73,team=alpha
ot-baggage-routing-key rk-2c46bd73
traceparent 00-54bd79d618adb625a2d7e8e76124b745-f894ee3d0d208e06-01
tracestate cptest=v1
x-cp-canary elastic-python--rabbitmq-http--60fe9ab6

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--60fe9ab6
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-34df77aa,team=alpha
ot-baggage-routing-key rk-34df77aa
traceparent 00-a368b1f040ae67982b94e3931f0337df-80658d4894cc45c0-01
tracestate cptest=v1
x-cp-canary elastic-python--rabbitmq-grpc--f3926665

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.85.1 grpc-c/58.0.0 (linux; chttp2)
test id
elastic-python--rabbitmq-grpc--f3926665
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-551d77b1,team=alpha
ot-baggage-routing-key rk-551d77b1
traceparent 00-526bd06deec5e170c38d3c8d5f58c6f2-d7351e02cc552da2-01
tracestate cptest=v1
x-cp-canary elastic-python--rabbitmq-kafka--a5b62b1b

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
elastic-python--rabbitmq-kafka--a5b62b1b
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-86c89f6c,team=alpha
ot-baggage-routing-key rk-86c89f6c
traceparent 00-2947f9e270c90189d2c55c7ad003ef90-5861234eb3a7e993-01
tracestate cptest=v1
x-cp-canary elastic-python--rabbitmq-rabbitmq--f4cf9a14

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

No headers observed.

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

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