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
24 Nov 2026, 18:58 UTC
Harness
26e0f41 · run run-2026-11-24.5
Raw JSON
run-2026-11-24.5.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-e0c49163,team=alpha
ot-baggage-routing-key rk-e0c49163
traceparent 00-8d0d3ab492dda2cf5d4bf4b516b748f5-7b2b3d8d623336c8-01
tracestate cptest=v1
x-cp-canary otel-php--http-http--3434a897

Observed at the sink on the outbound HTTP request headers

accept */*
baggage routing-key=rk-e0c49163,team=alpha
content-length 43
content-type application/json
traceparent 00-8d0d3ab492dda2cf5d4bf4b516b748f5-8fa844bd2ffdaad0-01
tracestate cptest=v1
test id
otel-php--http-http--3434a897
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-918a471a,team=alpha
ot-baggage-routing-key rk-918a471a
traceparent 00-86a2555e2661d1fe6df8bb3ae874c5f5-039a4809ba36e363-01
tracestate cptest=v1
x-cp-canary otel-php--http-grpc--82cc3a5f

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--82cc3a5f
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-70e19fa1,team=alpha
ot-baggage-routing-key rk-70e19fa1
traceparent 00-c36ce06304bf0dc720e05b32cad0adb1-be2379df68e1d9f7-01
tracestate cptest=v1
x-cp-canary otel-php--http-kafka--13dcd1d8

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-php--http-kafka--13dcd1d8
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-80fe262c,team=alpha
ot-baggage-routing-key rk-80fe262c
traceparent 00-ce7977827043bd463a1c22fb8e2cadcc-04397f43bad7ba5a-01
tracestate cptest=v1
x-cp-canary otel-php--http-rabbitmq--ca781b48

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

No headers observed.

test id
otel-php--http-rabbitmq--ca781b48
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-64374cb1,team=alpha
ot-baggage-routing-key rk-64374cb1
traceparent 00-114223cf1d670d29c411f5e7272cd0ac-85f6a5d90a8bd727-01
tracestate cptest=v1
x-cp-canary otel-php--grpc-http--fe362785

Observed at the sink on the outbound HTTP request headers

Nothing reached the sink.

test id
otel-php--grpc-http--fe362785
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-e5e1684b,team=alpha
ot-baggage-routing-key rk-e5e1684b
traceparent 00-232c65879d8d15ce0158e5c70ac3be44-c7c6c6b1826d52e0-01
tracestate cptest=v1
x-cp-canary otel-php--grpc-grpc--927cadb2

Observed at the sink on the outbound gRPC metadata

Nothing reached the sink.

test id
otel-php--grpc-grpc--927cadb2
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-367c5e11,team=alpha
ot-baggage-routing-key rk-367c5e11
traceparent 00-e140c1dce4a625a9c1bc0986466834dc-9b4fd77a734ab452-01
tracestate cptest=v1
x-cp-canary otel-php--grpc-kafka--dc192250

Observed at the sink on the outbound Kafka record headers

Nothing reached the sink.

test id
otel-php--grpc-kafka--dc192250
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-3df16c31,team=alpha
ot-baggage-routing-key rk-3df16c31
traceparent 00-d456e21af2e19ca7e260e43946fe1c81-5c9c472112f30529-01
tracestate cptest=v1
x-cp-canary otel-php--grpc-rabbitmq--32eb50e9

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

Nothing reached the sink.

test id
otel-php--grpc-rabbitmq--32eb50e9
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-dd888fc8,team=alpha
ot-baggage-routing-key rk-dd888fc8
traceparent 00-937d7cb5103a6b7922e84eb3d179a599-ea2ae3a17ff1befb-01
tracestate cptest=v1
x-cp-canary otel-php--kafka-http--500cfd83

Observed at the sink on the outbound HTTP request headers

accept */*
content-length 44
content-type application/json
traceparent 00-da6b2e8cfa2e7a448adb675b698099ec-1af3064c443245ef-01
test id
otel-php--kafka-http--500cfd83
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-85af0c85,team=alpha
ot-baggage-routing-key rk-85af0c85
traceparent 00-ff42eecf8241386dbdceca1c34084656-c31a8b0fe5ef0708-01
tracestate cptest=v1
x-cp-canary otel-php--kafka-grpc--18d89c79

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--18d89c79
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-fd83f803,team=alpha
ot-baggage-routing-key rk-fd83f803
traceparent 00-7d72d88437cc3a1b76a30b30857a624d-7fd5513b955aa4d3-01
tracestate cptest=v1
x-cp-canary otel-php--kafka-kafka--14d572be

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-php--kafka-kafka--14d572be
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-c6460523,team=alpha
ot-baggage-routing-key rk-c6460523
traceparent 00-325419d502acc42106d6cdb84045539f-e7b4c35d591fdc0d-01
tracestate cptest=v1
x-cp-canary otel-php--kafka-rabbitmq--349787d0

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

No headers observed.

test id
otel-php--kafka-rabbitmq--349787d0
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-b52266e0,team=alpha
ot-baggage-routing-key rk-b52266e0
traceparent 00-994c30f54885a363db9ac22ed6ef35bd-345606d590043ad2-01
tracestate cptest=v1
x-cp-canary otel-php--rabbitmq-http--b5cda36c

Observed at the sink on the outbound HTTP request headers

accept */*
content-length 47
content-type application/json
traceparent 00-a7cc780062776620adf180482dafd6a7-7287fbeb90fee1cc-01
test id
otel-php--rabbitmq-http--b5cda36c
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-64a6a89d,team=alpha
ot-baggage-routing-key rk-64a6a89d
traceparent 00-a23a8200926d4903a6bf164e4cb533cc-6a26c6c76462cb80-01
tracestate cptest=v1
x-cp-canary otel-php--rabbitmq-grpc--a83afc9a

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--a83afc9a
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-73bf3003,team=alpha
ot-baggage-routing-key rk-73bf3003
traceparent 00-c15c1a4a56f208c5c29e4fc034fcb35b-6b158aed2de22934-01
tracestate cptest=v1
x-cp-canary otel-php--rabbitmq-kafka--9a24162d

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-php--rabbitmq-kafka--9a24162d
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-86fa8ae7,team=alpha
ot-baggage-routing-key rk-86fa8ae7
traceparent 00-61b0a54d924b52ae1e7ea95e13edaf58-79bbb8c7c21324a1-01
tracestate cptest=v1
x-cp-canary otel-php--rabbitmq-rabbitmq--e1b38c19

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

No headers observed.

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

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