otel-php

PHP zero-code opentelemetry (ext)1.5.0

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

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

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.5.0 reported as open-telemetry/sdk 1.15.0 (ext-opentelemetry 1.5.0) 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
30 Nov 2026, 18:58 UTC
Harness
ae4b9c9 · measured in run-2026-11-30.1
Raw JSON
1.5.0.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.2.0
propagationopen-telemetry/api 1.13.0 + open-telemetry/context 1.6.0 + open-telemetry/sem-conv 1.45.1
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-699f4c77,team=alpha
ot-baggage-routing-key rk-699f4c77
traceparent 00-b06d2c27dc830649ff633187add1086b-ceb6f4b54de5c287-01
tracestate cptest=v1
x-cp-canary otel-php--http-http--6f3619e5

Observed at the sink on the outbound HTTP request headers

accept */*
baggage routing-key=rk-699f4c77,team=alpha
content-length 43
content-type application/json
traceparent 00-b06d2c27dc830649ff633187add1086b-9fa8ee81a5dfba1a-01
tracestate cptest=v1
test id
otel-php--http-http--6f3619e5
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-0f6a4b59,team=alpha
ot-baggage-routing-key rk-0f6a4b59
traceparent 00-0a4c0d255c99b2e8d6c2113e8fb557b0-d2265e2350f2a1e3-01
tracestate cptest=v1
x-cp-canary otel-php--http-grpc--081383a7

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--081383a7
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-fcffd263,team=alpha
ot-baggage-routing-key rk-fcffd263
traceparent 00-e1eff46dc38b57f0e3508d59bcafcecb-641cf6c251ca4908-01
tracestate cptest=v1
x-cp-canary otel-php--http-kafka--a6d049c3

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-php--http-kafka--a6d049c3
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-d49f0d2e,team=alpha
ot-baggage-routing-key rk-d49f0d2e
traceparent 00-1d9c4b3620fed85008ec445dfe044a0c-b4f8eda6e59c74f4-01
tracestate cptest=v1
x-cp-canary otel-php--http-rabbitmq--4e4d0569

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

No headers observed.

test id
otel-php--http-rabbitmq--4e4d0569
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-168010b7,team=alpha
ot-baggage-routing-key rk-168010b7
traceparent 00-aaf686fa42195c6a5fb54c5b7441e81a-d58c33e6a0b545d7-01
tracestate cptest=v1
x-cp-canary otel-php--grpc-http--6c1c2ad2

Observed at the sink on the outbound HTTP request headers

Nothing reached the sink.

test id
otel-php--grpc-http--6c1c2ad2
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-400852f8,team=alpha
ot-baggage-routing-key rk-400852f8
traceparent 00-9f9694163ba2e942dc678e892c212c6d-99ee91a0d1d5e004-01
tracestate cptest=v1
x-cp-canary otel-php--grpc-grpc--74a05737

Observed at the sink on the outbound gRPC metadata

Nothing reached the sink.

test id
otel-php--grpc-grpc--74a05737
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-31138c4a,team=alpha
ot-baggage-routing-key rk-31138c4a
traceparent 00-8591df7f72108783d9c3687298887f79-d257a403aa0bbb99-01
tracestate cptest=v1
x-cp-canary otel-php--grpc-kafka--a23d3787

Observed at the sink on the outbound Kafka record headers

Nothing reached the sink.

test id
otel-php--grpc-kafka--a23d3787
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-3155feac,team=alpha
ot-baggage-routing-key rk-3155feac
traceparent 00-e9a4bba531e6dc6e34ff13f772cc7c97-a34e97b07d842317-01
tracestate cptest=v1
x-cp-canary otel-php--grpc-rabbitmq--c539d41c

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

Nothing reached the sink.

test id
otel-php--grpc-rabbitmq--c539d41c
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-7b342298,team=alpha
ot-baggage-routing-key rk-7b342298
traceparent 00-c4f12d011cc29b8cc95a7646543bedfa-12579035e60d4bb5-01
tracestate cptest=v1
x-cp-canary otel-php--kafka-http--a124c592

Observed at the sink on the outbound HTTP request headers

accept */*
baggage routing-key=rk-7b342298,team=alpha
content-length 44
content-type application/json
traceparent 00-c4f12d011cc29b8cc95a7646543bedfa-e84c130933539e11-01
tracestate cptest=v1
test id
otel-php--kafka-http--a124c592
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-2a1e2f3a,team=alpha
ot-baggage-routing-key rk-2a1e2f3a
traceparent 00-3a791d2ad81294fc7c6fae1160343ed7-c1ae3f0425690c9e-01
tracestate cptest=v1
x-cp-canary otel-php--kafka-grpc--13815cba

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--13815cba
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-6000ff34,team=alpha
ot-baggage-routing-key rk-6000ff34
traceparent 00-dea347d69fbff597bcccaa55e8c2edd2-c4e1057041aae78d-01
tracestate cptest=v1
x-cp-canary otel-php--kafka-kafka--a5632aa5

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-php--kafka-kafka--a5632aa5
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-0132ebe7,team=alpha
ot-baggage-routing-key rk-0132ebe7
traceparent 00-7b161b9319ab87cbbef31590223afa80-95b04f914d669536-01
tracestate cptest=v1
x-cp-canary otel-php--kafka-rabbitmq--42fb0cdd

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

No headers observed.

test id
otel-php--kafka-rabbitmq--42fb0cdd
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-0b032138,team=alpha
ot-baggage-routing-key rk-0b032138
traceparent 00-53b084b7db17ff186c6546b83a36681f-297417ebe3ca89ec-01
tracestate cptest=v1
x-cp-canary otel-php--rabbitmq-http--283bf867

Observed at the sink on the outbound HTTP request headers

accept */*
content-length 47
content-type application/json
traceparent 00-c617f16e42eafdffd8f420a7285aba67-fd659a6e8b29dae3-01
test id
otel-php--rabbitmq-http--283bf867
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-1bffe603,team=alpha
ot-baggage-routing-key rk-1bffe603
traceparent 00-3c9b3ed27ae4cc775ed874eeb5173bd9-c7acc0a06102d57f-01
tracestate cptest=v1
x-cp-canary otel-php--rabbitmq-grpc--52980eec

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--52980eec
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-2348287a,team=alpha
ot-baggage-routing-key rk-2348287a
traceparent 00-7822e347dc2b1f14b991a12e392f39cc-df7c3005591f098b-01
tracestate cptest=v1
x-cp-canary otel-php--rabbitmq-kafka--2be1d6ab

Observed at the sink on the outbound Kafka record headers

No headers observed.

test id
otel-php--rabbitmq-kafka--2be1d6ab
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-efccd97b,team=alpha
ot-baggage-routing-key rk-efccd97b
traceparent 00-92d7a1809d62e4cdfd3708441ecba672-b07023f2ae7ef95f-01
tracestate cptest=v1
x-cp-canary otel-php--rabbitmq-rabbitmq--a8c6dec6

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

No headers observed.

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

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