otel-php

PHP zero-code opentelemetry (ext)1.2.0

attach ext-opentelemetry + auto-* packages via php.ini

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

Not compared with the uninstrumented PHP relay (no run on this site measured it on php 8.3.36).

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

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

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

12 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. From run-2026-11-09.6 to run-2026-11-30 it failed for a separate reason, otel-php-rdkafka-sem-conv-constants (both hooks of the instrumentation threw before they reached the propagator); it passes again from run-2026-11-30.1, with opentelemetry-auto-ext-rdkafka 0.2.0. The ini setting has not been re-measured since 2026-09-06. No upstream issue exists (filing candidate against open-telemetry/opentelemetry-php).

6 cells affected

otel-php-rdkafka-producev-headers-argument

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

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

resolved fixed in opentelemetry-auto-ext-rdkafka 0.2.0 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.

Every cell this note describes now passes with opentelemetry-auto-ext-rdkafka 0.2.0. It is kept as the record of what failed before (3 cells).

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 on 0.1.0: 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.

Fixed upstream in opentelemetry-auto-ext-rdkafka 0.2.0 (2026-11-28, opentelemetry-php-contrib PR #772): the package now requires sem-conv ^1.45 and reads the constants that release defines (MESSAGING_SYSTEM_NAME, KafkaIncubatingAttributes::KAFKA_MESSAGE_KEY, KAFKA_OFFSET), so neither hook throws. This matrix moved to 0.2.0 on 2026-11-30 and kafka->http passes again from run-2026-11-30.1. The SDK and extension versions did not change; the fix is the instrumentation package. http->kafka and kafka->kafka still fail, for the reason otel-php-rdkafka-producev-headers-argument describes.

3 cells, now passing

otel-php-rdkafka-sem-conv-constants

Versions measured

Tracer
opentelemetry 1.2.0 reported as open-telemetry/sdk 1.15.0 (ext-opentelemetry 1.2.0) 1.2.0 on pecl github
Runtime
php 8.3.36
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-* packages via php.ini
Relay source
relays/php
Ran at
1 Nov 2026, 04:30 UTC
Harness
e793604 · measured in backtest-otel-php-1.2.0
Raw JSON
1.2.0.json → variants[id = "otel-php"]

Libraries

grpcext-grpc 1.85.0 / grpc/grpc 1.82.0
http_clientext-curl 8.14.1
kafkaext-rdkafka 6.0.5
rabbitmqphp-amqplib v3.7.4
serverapache2 mod_php / slim 4.15.3

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-bb98df56,team=alpha
ot-baggage-routing-key rk-bb98df56
traceparent 00-9a0b88614a91f084e09dcbf7cd62f61f-2469d0229f637ebd-01
tracestate cptest=v1
x-cp-canary otel-php--http-http--c84af482

Observed at the sink on the outbound HTTP request headers

accept */*
baggage routing-key=rk-bb98df56,team=alpha
content-length 43
content-type application/json
traceparent 00-9a0b88614a91f084e09dcbf7cd62f61f-742df87c3b0d1dce-01
tracestate cptest=v1
test id
otel-php--http-http--c84af482
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-2f6922df,team=alpha
ot-baggage-routing-key rk-2f6922df
traceparent 00-a60baa3f6fddcdf2f5bec406a9ac0313-f9082e2163151ad4-01
tracestate cptest=v1
x-cp-canary otel-php--http-grpc--57ddd390

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.0 grpc-c/58.0.0 (linux; chttp2)
test id
otel-php--http-grpc--57ddd390
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-7ea6ef13,team=alpha
ot-baggage-routing-key rk-7ea6ef13
traceparent 00-3c6983e0e8be9eab1907db345dd4b559-63df67d6022aedbc-01
tracestate cptest=v1
x-cp-canary otel-php--http-kafka--e81572cd

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-php--http-kafka--e81572cd
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-2b06647e,team=alpha
ot-baggage-routing-key rk-2b06647e
traceparent 00-9042e344f304e2b74fc5e12c76330f95-cf6be44724d758f8-01
tracestate cptest=v1
x-cp-canary otel-php--http-rabbitmq--9fcc4ff6

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

No headers observed.

test id
otel-php--http-rabbitmq--9fcc4ff6
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-acefb6ae,team=alpha
ot-baggage-routing-key rk-acefb6ae
traceparent 00-a74c524c5ba52616fc08404f00177bd6-290acc9d08e30c54-01
tracestate cptest=v1
x-cp-canary otel-php--grpc-http--3a1013d7

Observed at the sink on the outbound HTTP request headers

Nothing reached the sink.

test id
otel-php--grpc-http--3a1013d7
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-2ea25287,team=alpha
ot-baggage-routing-key rk-2ea25287
traceparent 00-8ae156013427678cb0072f552d664469-1ce7bf008d9c7a24-01
tracestate cptest=v1
x-cp-canary otel-php--grpc-grpc--985afaf4

Observed at the sink on the outbound gRPC metadata

Nothing reached the sink.

test id
otel-php--grpc-grpc--985afaf4
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-e52e0559,team=alpha
ot-baggage-routing-key rk-e52e0559
traceparent 00-d0dea1b052b44a7e060398057bc579e6-1b115ab965e21df5-01
tracestate cptest=v1
x-cp-canary otel-php--grpc-kafka--eb5141e9

Observed at the sink on the outbound Kafka record headers

Nothing reached the sink.

test id
otel-php--grpc-kafka--eb5141e9
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-d9e730de,team=alpha
ot-baggage-routing-key rk-d9e730de
traceparent 00-98a8e9446347e5360c8a4689dac37151-c0f897fc0bd1471c-01
tracestate cptest=v1
x-cp-canary otel-php--grpc-rabbitmq--837c4196

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

Nothing reached the sink.

test id
otel-php--grpc-rabbitmq--837c4196
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-d759cc18,team=alpha
ot-baggage-routing-key rk-d759cc18
traceparent 00-7f900e3d7e277773d95385f4f91d4733-fc73f23aa408667d-01
tracestate cptest=v1
x-cp-canary otel-php--kafka-http--ab8a0078

Observed at the sink on the outbound HTTP request headers

accept */*
baggage routing-key=rk-d759cc18,team=alpha
content-length 44
content-type application/json
traceparent 00-7f900e3d7e277773d95385f4f91d4733-86ff257953983d89-01
tracestate cptest=v1
test id
otel-php--kafka-http--ab8a0078
raw statuses
baggage=propagatedtracestate=preservedtraceparent=same_traceot_baggage=absent
Kafka gRPC baggage tracestate traceparent ot-baggage delivered via grpc

Seeded on the inbound Kafka record headers

baggage routing-key=rk-e93a737e,team=alpha
ot-baggage-routing-key rk-e93a737e
traceparent 00-46e95535581d5bc7e425d2c58b349bda-f9259e7afadcb0f5-01
tracestate cptest=v1
x-cp-canary otel-php--kafka-grpc--2611d0f2

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.0 grpc-c/58.0.0 (linux; chttp2)
test id
otel-php--kafka-grpc--2611d0f2
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-1d3c3531,team=alpha
ot-baggage-routing-key rk-1d3c3531
traceparent 00-2a5136dd8dbcdafc3a561c7c044c08f0-1b3813d0cbf7557b-01
tracestate cptest=v1
x-cp-canary otel-php--kafka-kafka--71ec946d

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-php--kafka-kafka--71ec946d
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-7c3cd174,team=alpha
ot-baggage-routing-key rk-7c3cd174
traceparent 00-be9fd8c129b0525d0a9fadad2bae37e6-15e14829b104c3f1-01
tracestate cptest=v1
x-cp-canary otel-php--kafka-rabbitmq--61e6e931

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

No headers observed.

test id
otel-php--kafka-rabbitmq--61e6e931
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-8420f2dc,team=alpha
ot-baggage-routing-key rk-8420f2dc
traceparent 00-f60e77e7204f592f0b5a0f95093d5667-9d901ad08044d2cd-01
tracestate cptest=v1
x-cp-canary otel-php--rabbitmq-http--b5abdc5a

Observed at the sink on the outbound HTTP request headers

accept */*
content-length 47
content-type application/json
traceparent 00-79d2bd1cd0f21fd9bedb22314d77ae0d-6c97e583c73764fc-01
test id
otel-php--rabbitmq-http--b5abdc5a
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-aedac2b5,team=alpha
ot-baggage-routing-key rk-aedac2b5
traceparent 00-feae15afd1c32117f29de0296729ac6c-75f68c1d89536ee0-01
tracestate cptest=v1
x-cp-canary otel-php--rabbitmq-grpc--05379c9c

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.0 grpc-c/58.0.0 (linux; chttp2)
test id
otel-php--rabbitmq-grpc--05379c9c
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-cc08b31b,team=alpha
ot-baggage-routing-key rk-cc08b31b
traceparent 00-bf9497b4c1db715d30c70f8d46fb7aa2-06c8e4c8ef1fd04b-01
tracestate cptest=v1
x-cp-canary otel-php--rabbitmq-kafka--abb3f80d

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-php--rabbitmq-kafka--abb3f80d
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-5a2039f7,team=alpha
ot-baggage-routing-key rk-5a2039f7
traceparent 00-1c3b93c2c534c30945f973290400709d-6fbfa7e35773fe10-01
tracestate cptest=v1
x-cp-canary otel-php--rabbitmq-rabbitmq--634d8b25

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

No headers observed.

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

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