The OpenTelemetry Symfony bundle is driven primarily by the standard OpenTelemetry SDK environment variables — the same ones used across every OTel language SDK. You set them in yourDocumentation 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.
.env file, your container environment, or through the bundle’s sdk: configuration section. A small number of Symfony-specific options supplement the standard set.
Environment variable reference
| Variable | Example value | Description |
|---|---|---|
OTEL_PHP_AUTOLOAD_ENABLED | true | Enables SDK auto-initialization. Must be true for the bundle’s instrumentation to emit signals. See the SDK Setup guide if DotEnv timing causes this to be set too late. |
OTEL_SERVICE_NAME | my-symfony-app | The service name shown in your observability backend (Jaeger, Tempo, Traceway, etc.). |
OTEL_TRACES_EXPORTER | otlp | Traces exporter. Accepted values: otlp, zipkin, console, none. |
OTEL_LOGS_EXPORTER | otlp | Logs exporter. Accepted values: otlp, console, none. Only used when logs.export.enabled: true in bundle config. |
OTEL_METRICS_EXPORTER | otlp | Metrics exporter. Accepted values: otlp, console, none. Only used when metrics.enabled: true in bundle config. |
OTEL_EXPORTER_OTLP_ENDPOINT | http://localhost:4318 | Base URL of your OTel Collector or backend OTLP endpoint. The bundle automatically excludes this host from HTTP client tracing to prevent trace loops. |
OTEL_EXPORTER_OTLP_PROTOCOL | http/json | Wire protocol for the OTLP exporter. Accepted values: http/json, http/protobuf, grpc. The grpc value requires additional packages — see gRPC transport below. |
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT | http://localhost:4318/v1/metrics | Override the OTLP endpoint specifically for metrics. Useful when your metrics backend uses a different address than your traces and logs backend. |
.env.local for local development looks like this:
gRPC transport
The bundle ships only the pure-PHP OTLP transports (http/json and http/protobuf). To use OTEL_EXPORTER_OTLP_PROTOCOL=grpc you must install two additional pieces:
ext-grpc— the PHP gRPC PECL extensionopen-telemetry/transport-grpc— the Composer package that wiresext-grpcinto the OTel PHP SDK
ext-protobuf is also strongly recommended alongside gRPC; without it the SDK falls back to a slower pure-PHP protobuf implementation.
gRPC endpoints use port 4317 by convention, while HTTP/JSON and HTTP/Protobuf use port 4318. Make sure your endpoint URL and protocol match.
grpc is selected as the protocol but ext-grpc or open-telemetry/transport-grpc is missing, helping you catch misconfiguration before it reaches production.
Full SDK variable list
The variables listed above cover the most common Symfony use cases. The OpenTelemetry PHP SDK supports a much larger set of environment variables for configuring sampling, propagation, batch export timeouts, resource detectors, and more.OpenTelemetry PHP SDK documentation
Full list of supported environment variables and exporters for the PHP SDK.
