Skip to main content

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.

The bundle exports traces, metrics, and logs to any OpenTelemetry-compatible backend through standard OTEL_* environment variables. There is no backend-specific code in the bundle itself — every integration is a matter of pointing OTEL_EXPORTER_OTLP_ENDPOINT at the right address and, where required, supplying authentication headers. The examples below show the minimal configuration for each supported backend.

Supported backends

Traceway

Native Symfony observability platform built around the OpenTelemetry Symfony Bundle. Accepts OTLP over HTTP/JSON with no extra configuration — point your endpoint at the Traceway ingest URL and set your API key as an OTLP header.

Jaeger

Open-source distributed tracing with a built-in UI. Accepts OTLP directly on port 4318 (HTTP) or 4317 (gRPC) since Jaeger v1.35. Also supports the Zipkin JSON format if you prefer that transport.

Grafana Tempo

High-scale distributed tracing backend that is part of the Grafana observability stack. Accepts OTLP over HTTP or gRPC and integrates natively with Grafana dashboards and Loki log correlation.

Zipkin

Lightweight tracing backend with a simple query UI. Set OTEL_TRACES_EXPORTER=zipkin and install the open-telemetry/exporter-zipkin package to use the Zipkin JSON format instead of OTLP.

Datadog

Send traces via the Datadog Agent’s OTLP intake (enabled by default since Agent 7.30) or directly to Datadog’s OTLP ingest endpoint. Set the endpoint to http://localhost:4318 when using a local Agent.

Honeycomb

Set OTEL_EXPORTER_OTLP_ENDPOINT to https://api.honeycomb.io and pass your API key via OTEL_EXPORTER_OTLP_HEADERS. The bundle’s sdk.exporter_otlp_headers config key lets you inject the header from a Symfony Secret rather than a plain env var.

AWS X-Ray

Use with the AWS Distro for OpenTelemetry (ADOT) Collector and enable the propagator: xray and id_generator: xray bundle config keys for native X-Ray header and ID support. See the AWS X-Ray integration page for full setup instructions.

OpenTelemetry Collector

The official OTel Collector is recommended for all production deployments. Run it alongside your app to gain retries, buffering, fan-out to multiple backends, and fast PHP-FPM request shutdown.

Using an OTel Collector

Running a local OpenTelemetry Collector is the recommended production deployment pattern. The Collector decouples your application from the backend, handles retries and buffering on your behalf, and lets you export to multiple destinations simultaneously — all without changing application code. Benefits at a glance:
  • Sub-millisecond export latency when the Collector runs on the same host as PHP-FPM, keeping request shutdown fast
  • Retries and persistent queues absorb temporary backend outages without losing spans
  • Fan-out pipelines send the same data to Jaeger for local debugging and Grafana Tempo for long-term retention in one config change
  • Attribute processors let you redact PII or add environment tags centrally, outside the application
The minimal environment variable setup points the bundle at a local Collector:
OTEL_PHP_AUTOLOAD_ENABLED=true
OTEL_SERVICE_NAME=my-symfony-app
OTEL_TRACES_EXPORTER=otlp
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
OTEL_EXPORTER_OTLP_PROTOCOL=http/json
The OTLP exporter endpoint is automatically excluded from HttpClient tracing. If your Collector is at localhost:4318, the bundle will not create spans for the export requests themselves, preventing infinite trace loops.

Protocol selection

The bundle ships the pure-PHP OTLP transports out of the box. Choose the protocol that fits your infrastructure and performance requirements.
The default protocol. Uses the native PHP JSON encoder — no C extension required. Well-suited for development environments and managed hosting where installing PECL extensions is not possible.
OTEL_EXPORTER_OTLP_PROTOCOL=http/json
Requires: nothing beyond the base bundle install.
ProtocolEncodingExtension neededRelative speed
http/jsonJSON over HTTP/1.1NoneBaseline
http/protobufProtobuf over HTTP/1.1ext-protobufFaster serialization
grpcProtobuf over HTTP/2ext-grpc + open-telemetry/transport-grpc (+ ext-protobuf recommended)Fastest; persistent connection
Run bin/console traceway:doctor after changing the protocol — it will warn if the required extension is missing or if the Collector endpoint is unreachable.

Build docs developers (and LLMs) love