The bundle ships native AWS X-Ray support through two optional configuration keys —Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tracewayapp/opentelemetry-symfony-bundle/llms.txt
Use this file to discover all available pages before exploring further.
propagator: xray and id_generator: xray — that replace the default W3C propagation and ID generation with their AWS equivalents. Both options require the open-telemetry/contrib-aws Composer package, and a clear LogicException is thrown at container boot if that package is absent when either key is set.
Prerequisites
Install the AWS contrib package before enabling either X-Ray option:Setup
Install the contrib-aws package
The
open-telemetry/contrib-aws package provides both the X-Amzn-Trace-Id propagator and the epoch-prefixed ID generator used by the X-Ray UI. It is an optional dependency of the bundle and is not installed by default.Configure propagator and id_generator
Add the two X-Ray keys to your
config/packages/open_telemetry.yaml. Both keys are independent — you can use just the propagator, just the ID generator, or both together.Propagator modes
Thepropagator key controls which HTTP headers carry trace context between services. Choose the mode that matches your deployment.
| Value | Header written / read | Use when |
|---|---|---|
w3c (default) | traceparent / tracestate | All non-X-Ray backends |
xray | X-Amzn-Trace-Id | Full X-Ray setup — all services speak X-Ray |
w3c+xray | Both | Migrating from W3C to X-Ray; services that accept either format |
w3c+xray is implemented as a MultiTextMapPropagator wrapping both TraceContextPropagator and the X-Ray propagator, so every outgoing request and incoming extraction writes and reads both header formats simultaneously.All context propagation in the bundle — outgoing HttpClient requests, Messenger stamps, and incoming request extraction — reads from
Globals::propagator(). Switching the propagator key is therefore automatic and complete across every instrumented component; no per-integration changes are needed.X-Ray ID generator
Settingid_generator: xray makes the bundle build a TracerProvider using the standard SDK env-var auto-configuration (OTEL_TRACES_EXPORTER, OTEL_TRACES_SAMPLER, OTEL_PHP_TRACES_PROCESSOR) and substitutes in the X-Ray ID generator.
The X-Ray ID generator produces 32-character hex trace IDs whose first 8 characters encode the Unix timestamp of the root span. X-Ray’s UI uses this epoch prefix to render request times in its trace list without fetching the full trace body — which means timestamps appear instantly in the console even on high-cardinality services.
id_generator: xray makes the bundle own the TracerProvider. If you also bootstrap your own TracerProvider in code, initialise it before the Symfony kernel boots so the bundle’s initializer, which registers later via Globals::registerInitializer(), can take precedence. For setups that rely only on OTEL_* environment variables this ordering is handled automatically.