otel-php

PHP zero-code opentelemetry (ext)1.5.0

attach ext-opentelemetry + auto-* composer packages, OTEL_PHP_AUTOLOAD_ENABLED=true

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

Explanations

PHP: no gRPC server exists in any tracer-supported topology, so gRPC-inbound is undeliverable

app-limitation The official gRPC PHP implementation is client-only; the harness's Apache mod_php + CLI worker topology cannot accept gRPC calls, so grpc->* hops never run.

grpc.io's PHP quickstart: "You can only create gRPC clients in PHP. Use another language to create a gRPC server." (Restated in grpc/grpc #38481, open, filed by a Google engineer.) PHP can serve gRPC through a separate application server: RoadRunner's gRPC plugin (Go proxy → PHP workers) or Swoole-based frameworks such as Hyperf. But none of the tracers' zero-code instrumentation covers those paths: dd-trace-php's RoadRunner integration hooks the HTTP PSR7Worker only (Datadog's guidance for RoadRunner gRPC is manual dd_trace_method hooks, dd-trace-php #805); OTel has no roadrunner-grpc PHP instrumentation (RoadRunner's otel plugin traces in the Go proxy layer, not the PHP worker); Elastic and New Relic support neither.

The harness measures the documented Apache mod_php + two CLI workers topology, the supported deployment for all three tracers (dd-trace-php does not support php -S), so every grpc->* boundary is undelivered for every PHP variant including the baseline. A RoadRunner-based relay with manual instrumentation is a candidate follow-up (see the roadmap in DESIGN.md).

80 cells affected

php-no-grpc-server

PHP: no tool instruments the ext-grpc client, so every *->grpc leg is header-free

open Neither OTel PHP, dd-trace-php, Elastic PHP nor New Relic PHP hooks ext-grpc + grpc/grpc client calls; no metadata is injected on any *->grpc boundary.

Every *->grpc cell is header-free for otel, datadog, elastic and newrelic alike: the outbound gRPC client (ext-grpc + grpc/grpc) is not on any tool's instrumentation list, so nothing is injected into call metadata.

Datadog: dd-trace-php #916 is the canonical gRPC request, open since 2020 and marked "up-for-grabs" ("We do not have enough bandwidth to work on this integration during this quarter"); gRPC is absent from Datadog's PHP compatibility tables. OpenTelemetry: the opentelemetry-php-contrib instrumentation tree (30 auto-instrumentations) contains no gRPC entry. gRPC exists in the OTel PHP ecosystem only as the OTLP export transport; we found no issue proposing instrumentation of ext-grpc client calls. Elastic and New Relic list ext-grpc as unsupported.

Workaround: add the propagation headers to the call's metadata array yourself at every gRPC call site, using the tool's propagator/inject API.

30 cells affected

php-grpc-client-not-instrumented

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).

140 cells affected

otel-ot-baggage-not-default

OTel PHP: rdkafka producev() injection silently no-ops unless the $headers argument is present

config ext-opentelemetry drops arguments a pre-hook adds to a native function call, so the rdkafka instrumentation's injected $headers never reach producev().

The ExtRdKafka instrumentation does set $params[4] (the $headers slot) from its pre-hook unconditionally. But the ext-opentelemetry extension silently drops arguments added to internal functions ever since argument expansion was disabled to prevent a segfault (PR #84, formalised in PR #120; original crash opentelemetry-php #1155). A naive producev($partition, 0, $payload) therefore gets no headers at all, while producev($partition, 0, $payload, null, []) (an explicit empty array) makes injection (baggage included) work. Verified empirically both ways; the drop produced no error_log line in our runs.

Escape hatch, documented only in the extension repo's README: opentelemetry.allow_stack_extension=On. With that ini set, the naive call injects traceparent, tracestate and baggage and http->kafka / kafka->kafka flip to pass (the run is archived in the harness repository as results/experiments/otel-php-allow-stack-extension.json). Neither the argument requirement nor the ini setting is mentioned in the ExtRdKafka README.

This asymmetry is outbound-only: with the packages of that run (2026-09-06), consume-side extraction worked and kafka->http passed. It has failed since run-2026-11-09.6 for a separate reason, otel-php-rdkafka-sem-conv-constants: both hooks of the instrumentation now throw before they reach the propagator. The ini setting has not been re-measured with those packages. No upstream issue exists (filing candidate against open-telemetry/opentelemetry-php).

6 cells affected

otel-php-rdkafka-producev-headers-argument

OTel PHP: the rdkafka instrumentation throws on every message with sem-conv 1.45.0, so a consumed message's context is never extracted

open opentelemetry-auto-ext-rdkafka 0.1.0 reads constants that open-telemetry/sem-conv 1.45.0 no longer defines, so its consume() hook throws before it extracts the incoming context.

opentelemetry-auto-ext-rdkafka 0.1.0 sets its span attributes from MessagingIncubatingAttributes::MESSAGING_SYSTEM, MESSAGING_SYSTEM_VALUE_KAFKA, MESSAGING_KAFKA_MESSAGE_KEY and MESSAGING_KAFKA_OFFSET (since opentelemetry-php-contrib PR #689, which moved the instrumentations off the deprecated TraceAttributes). In open-telemetry/sem-conv 1.45.0 (2026-11-03) that class defines none of the four; in 1.44.0 it defines all of them. The package requires open-telemetry/sem-conv: ^1.36, which 1.45.0 satisfies, and a fresh composer require installs 1.45.0.

Both hooks read the constants while they build the span, before they touch the propagator. The extension catches the error and logs a warning; the relay log has RdKafka\KafkaConsumer::consume(): OpenTelemetry: post hook threw exception ... Undefined constant OpenTelemetry\SemConv\Incubating\Attributes\MessagingIncubatingAttributes::MESSAGING_SYSTEM. consume() still returns the message and the relay forwards it, with no context attached, so the curl instrumentation starts a new trace: a new traceparent, no tracestate, no baggage. The producev() pre-hook throws the same error, on the two boundaries that already fail for another reason (otel-php-rdkafka-producev-headers-argument).

Measured 2026-11-11 with ext-opentelemetry 1.5.0 and open-telemetry/sdk 1.15.0, one package changed per build. With 0.1.0 and sem-conv 1.45.0, what a fresh install resolves to, the three headers fail. With 0.0.5 and sem-conv 1.45.0 they pass: 0.0.5 reads the TraceAttributes constants, which 1.45.0 still defines. With 0.1.0 and sem-conv 1.44.0 they pass. The other 61 cells are the same in all three builds, and putting the slim or the curl instrumentation back to its previous release changes nothing. The three runs are archived in the harness repository under results/experiments/ (otel-php-kafka-http-current.json, otel-php-kafka-http-rdkafka-0.0.5.json and otel-php-kafka-http-sem-conv-1.44.0.json); info.libs in each names the packages installed.

This matrix moved from 0.0.5 to 0.1.0 on 2026-11-09. That, and not the extension version, is why kafka->http passes in earlier runs, and why a back-test of an older extension passes if it was built before that date and fails if it was built after.

Workaround: require open-telemetry/sem-conv:1.44.0 beside the instrumentation, or stay on opentelemetry-auto-ext-rdkafka 0.0.5. opentelemetry-php-contrib main still read the constants on 2026-11-11, and we found no upstream issue about it.

3 cells affected

otel-php-rdkafka-sem-conv-constants

OTel PHP: no php-amqplib instrumentation exists, so every RabbitMQ leg loses context

open opentelemetry-php-contrib has no instrumentation for php-amqplib; its only AMQP coverage is the PECL ext-amqp client, a different library.

The opentelemetry-php-contrib instrumentation tree has no PhpAmqpLib entry. Its only AMQP coverage is ExtAmqp (the PECL ext-amqp client), and even there consumers are manual by design. Nothing is injected on *->rabbitmq, and nothing is extracted on rabbitmq->*; where the outbound HTTP client is instrumented (rabbitmq->http) it injects a fresh trace.

Consumer hooks are structurally hard in PHP (opentelemetry-php #937: "You cannot hook an anonymous function, only methods"; consume callbacks are closures).

Workaround: use the OTel PHP propagator API to inject into the message's application headers on publish and extract/attach in the consume callback. We found no upstream feature request for php-amqplib, although it is the dominant PHP AMQP client.

18 cells affected

otel-php-amqplib-not-instrumented

Versions in this run

Tracer
opentelemetry 1.5.0 reported as open-telemetry/sdk 1.15.0 (ext-opentelemetry 1.5.0) this version 1.5.0 on pecl github
Runtime
php 8.5.13
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
ext-opentelemetry + auto-* composer packages, OTEL_PHP_AUTOLOAD_ENABLED=true
Relay source
relays/php
Ran at
25 Nov 2026, 00:15 UTC
Harness
b9a3348 · run run-2026-11-25.1
Raw JSON
run-2026-11-25.1.json → variants[id = "otel-php"]

Libraries

grpcext-grpc 1.85.4 / grpc/grpc 1.85.4
http_clientext-curl 8.14.1 + open-telemetry/opentelemetry-auto-curl 0.4.0
kafkaext-rdkafka 6.0.5 + open-telemetry/opentelemetry-auto-ext-rdkafka 0.1.0
propagationopen-telemetry/api 1.12.0 + open-telemetry/context 1.6.0 + open-telemetry/sem-conv 1.45.0
rabbitmqphp-amqplib v3.7.5
serverapache2 mod_php / slim 4.15.3 + open-telemetry/opentelemetry-auto-slim 1.5.1

Configuration

OTEL_LOGS_EXPORTERnone
OTEL_METRICS_EXPORTERnone
OTEL_PHP_AUTOLOAD_ENABLEDtrue
OTEL_PROPAGATORStracecontext,baggage
OTEL_SERVICE_NAMErelay-otel-php
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-599fb62c,team=alpha
ot-baggage-routing-key rk-599fb62c
traceparent 00-3d66c153b262bcd10d65f05fe0a8986c-ed13496949b10fa1-01
tracestate cptest=v1
x-cp-canary otel-php--http-http--ac4313fb

Observed at the sink on the outbound HTTP request headers

accept */*
baggage routing-key=rk-599fb62c,team=alpha
content-length 43
content-type application/json
traceparent 00-3d66c153b262bcd10d65f05fe0a8986c-c42798846ada4b44-01
tracestate cptest=v1
test id
otel-php--http-http--ac4313fb
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-ca465bae,team=alpha
ot-baggage-routing-key rk-ca465bae
traceparent 00-16c34b4d32650159adf006b6d0715f54-4461f6fa45c7f4d6-01
tracestate cptest=v1
x-cp-canary otel-php--http-grpc--e99caf2c

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-php/1.85.4 grpc-c/58.0.0 (linux; chttp2)
test id
otel-php--http-grpc--e99caf2c
raw statuses
baggage=absenttracestate=absenttraceparent=absentot_baggage=absent
HTTP Kafka baggage tracestate traceparent ot-baggage delivered via kafka

Seeded on the inbound HTTP request headers

baggage routing-key=rk-2a2817c7,team=alpha
ot-baggage-routing-key rk-2a2817c7
traceparent 00-f167d0b516e90c6aa7e9319cd63d07bb-905c870283e39e31-01
tracestate cptest=v1
x-cp-canary otel-php--http-kafka--629a2d0a

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-php--http-kafka--629a2d0a
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-7a9e5bc7,team=alpha
ot-baggage-routing-key rk-7a9e5bc7
traceparent 00-5dc12b18e5b8f3596153a6e7d966cdf1-42c19707c3930f75-01
tracestate cptest=v1
x-cp-canary otel-php--http-rabbitmq--498c638c

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

No headers observed.

test id
otel-php--http-rabbitmq--498c638c
raw statuses
baggage=absenttracestate=absenttraceparent=absentot_baggage=absent
gRPC HTTP baggage tracestate traceparent ot-baggage undelivered

Error: send: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 172.18.0.5:8081: connect: connection refused"

Seeded on the inbound gRPC metadata

baggage routing-key=rk-3ac64b8e,team=alpha
ot-baggage-routing-key rk-3ac64b8e
traceparent 00-023bbc7bf287e6503806b4c9cc2edce2-4044514084c28481-01
tracestate cptest=v1
x-cp-canary otel-php--grpc-http--4c584f75

Observed at the sink on the outbound HTTP request headers

Nothing reached the sink.

test id
otel-php--grpc-http--4c584f75
raw statuses
baggage=—tracestate=—traceparent=—ot_baggage=—
gRPC gRPC baggage tracestate traceparent ot-baggage undelivered

Error: send: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 172.18.0.5:8081: connect: connection refused"

Seeded on the inbound gRPC metadata

baggage routing-key=rk-90a97d64,team=alpha
ot-baggage-routing-key rk-90a97d64
traceparent 00-218ee17991fa9172af6ad0f8033d2c07-3d61fd0f9cb7452e-01
tracestate cptest=v1
x-cp-canary otel-php--grpc-grpc--257bd65e

Observed at the sink on the outbound gRPC metadata

Nothing reached the sink.

test id
otel-php--grpc-grpc--257bd65e
raw statuses
baggage=—tracestate=—traceparent=—ot_baggage=—
gRPC Kafka baggage tracestate traceparent ot-baggage undelivered

Error: send: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 172.18.0.5:8081: connect: connection refused"

Seeded on the inbound gRPC metadata

baggage routing-key=rk-0954eaf0,team=alpha
ot-baggage-routing-key rk-0954eaf0
traceparent 00-96384e38e6da09a4abed60e59c9b33ec-4dc271033f618dbc-01
tracestate cptest=v1
x-cp-canary otel-php--grpc-kafka--0e93d28d

Observed at the sink on the outbound Kafka record headers

Nothing reached the sink.

test id
otel-php--grpc-kafka--0e93d28d
raw statuses
baggage=—tracestate=—traceparent=—ot_baggage=—
gRPC RabbitMQ baggage tracestate traceparent ot-baggage undelivered

Error: send: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 172.18.0.5:8081: connect: connection refused"

Seeded on the inbound gRPC metadata

baggage routing-key=rk-e8562caf,team=alpha
ot-baggage-routing-key rk-e8562caf
traceparent 00-9ef1e39bfa62fae88845996d328df030-74f8b1c694904828-01
tracestate cptest=v1
x-cp-canary otel-php--grpc-rabbitmq--224658cf

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

Nothing reached the sink.

test id
otel-php--grpc-rabbitmq--224658cf
raw statuses
baggage=—tracestate=—traceparent=—ot_baggage=—
Kafka HTTP baggage tracestate traceparent ot-baggage delivered via http

Seeded on the inbound Kafka record headers

baggage routing-key=rk-3eefdc01,team=alpha
ot-baggage-routing-key rk-3eefdc01
traceparent 00-90f19d99100265a8cc8adfb7de508b29-70b6fbb5ac491a2e-01
tracestate cptest=v1
x-cp-canary otel-php--kafka-http--1bcb01a4

Observed at the sink on the outbound HTTP request headers

accept */*
content-length 44
content-type application/json
traceparent 00-863cc8fce3f8eb3355d8397bc1acd69d-20cb0b4c799f4e3e-01
test id
otel-php--kafka-http--1bcb01a4
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-8b971627,team=alpha
ot-baggage-routing-key rk-8b971627
traceparent 00-c784192280b2d135b4d3cdc21941eeb4-f304bab2bc08e301-01
tracestate cptest=v1
x-cp-canary otel-php--kafka-grpc--9e2a01fd

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-php/1.85.4 grpc-c/58.0.0 (linux; chttp2)
test id
otel-php--kafka-grpc--9e2a01fd
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-4b2f280c,team=alpha
ot-baggage-routing-key rk-4b2f280c
traceparent 00-ed0e276af758e7dfd9e5a82f8dd8fc6c-98559358be9dcc48-01
tracestate cptest=v1
x-cp-canary otel-php--kafka-kafka--d5d1b467

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-php--kafka-kafka--d5d1b467
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-6efc0710,team=alpha
ot-baggage-routing-key rk-6efc0710
traceparent 00-e2fd8bca13345a77f8d1a974eb08124b-107e8f4cce74f7b2-01
tracestate cptest=v1
x-cp-canary otel-php--kafka-rabbitmq--445dcb73

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

No headers observed.

test id
otel-php--kafka-rabbitmq--445dcb73
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-c0a45b01,team=alpha
ot-baggage-routing-key rk-c0a45b01
traceparent 00-d0199ce3c2a8ff8e6540a36593499a65-825a7b59a86ba33b-01
tracestate cptest=v1
x-cp-canary otel-php--rabbitmq-http--5cc683fc

Observed at the sink on the outbound HTTP request headers

accept */*
content-length 47
content-type application/json
traceparent 00-b58fd256f0a5799f96a2ccf18d8aa4a0-2fa29ff1a5f2bc29-01
test id
otel-php--rabbitmq-http--5cc683fc
raw statuses
baggage=absenttracestate=absenttraceparent=new_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-cff4196e,team=alpha
ot-baggage-routing-key rk-cff4196e
traceparent 00-b1799cb1f5ee84b182a0857da5f884a7-e5eb3109c30a8330-01
tracestate cptest=v1
x-cp-canary otel-php--rabbitmq-grpc--5a52c3c4

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-php/1.85.4 grpc-c/58.0.0 (linux; chttp2)
test id
otel-php--rabbitmq-grpc--5a52c3c4
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-a14aec94,team=alpha
ot-baggage-routing-key rk-a14aec94
traceparent 00-eecd5e9c2c7bf9ef2a9c3f99c67c154c-851088de5dc03983-01
tracestate cptest=v1
x-cp-canary otel-php--rabbitmq-kafka--3c3af85b

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-php--rabbitmq-kafka--3c3af85b
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-3e7bea3c,team=alpha
ot-baggage-routing-key rk-3e7bea3c
traceparent 00-7901b6a9a95c3d4ca0519595265cb7c9-da36664e9f401458-01
tracestate cptest=v1
x-cp-canary otel-php--rabbitmq-rabbitmq--ced932c1

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

No headers observed.

test id
otel-php--rabbitmq-rabbitmq--ced932c1
raw statuses
baggage=absenttracestate=absenttraceparent=absentot_baggage=absent

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