Skip to main content
Most configuration options in config/opentelemetry.php can be set via environment variables. This page lists every supported variable grouped by category.
Variables that follow the official OpenTelemetry specification (prefixed OTEL_) are read directly by both the package and the underlying OpenTelemetry PHP SDK.
VariableDescriptionDefault
OTEL_SDK_DISABLEDDisable the OpenTelemetry SDK entirely. No telemetry data is collected or exported.false
OTEL_SERVICE_NAMELogical name of your service, reported on all telemetry.Slugified APP_NAME
OTEL_SERVICE_INSTANCE_IDUnique identifier for this instance of the service. A random ID is generated per request when not set.
OTEL_RESOURCE_ATTRIBUTESAdditional resource attributes attached to all telemetry. Format: key1=value1,key2=value2.
OTEL_USER_CONTEXTAttach the authenticated user ID as user.id on root spans and log records.true
OTEL_PROPAGATORSComma-separated list of context propagators. Options: tracecontext, baggage, b3, b3multi, none.tracecontext
OTLP (default exporter)
VariableDescriptionDefault
OTEL_EXPORTER_OTLP_ENDPOINTBase URL of the OTLP receiver for all signals.http://localhost:4318
OTEL_EXPORTER_OTLP_PROTOCOLTransport protocol for all signals. Options: grpc, http/protobuf, http/json.http/protobuf
OTEL_EXPORTER_OTLP_HEADERSDefault HTTP headers for all OTLP export requests. Format: key=value,key=value.
OTEL_EXPORTER_OTLP_TIMEOUTDefault export timeout in milliseconds for all signals.10000
OTEL_EXPORTER_OTLP_MAX_RETRIESNumber of retry attempts on transient failures.3
Per-signal overrides — Traces
VariableDescriptionDefault
OTEL_EXPORTER_OTLP_TRACES_PROTOCOLOverride transport protocol for traces.OTEL_EXPORTER_OTLP_PROTOCOL
OTEL_EXPORTER_OTLP_TRACES_HEADERSOverride HTTP headers for trace export requests.OTEL_EXPORTER_OTLP_HEADERS
OTEL_EXPORTER_OTLP_TRACES_TIMEOUTOverride timeout (ms) for trace export requests.OTEL_EXPORTER_OTLP_TIMEOUT
Per-signal overrides — Metrics
VariableDescriptionDefault
OTEL_EXPORTER_OTLP_METRICS_PROTOCOLOverride transport protocol for metrics.OTEL_EXPORTER_OTLP_PROTOCOL
OTEL_EXPORTER_OTLP_METRICS_HEADERSOverride HTTP headers for metrics export requests.OTEL_EXPORTER_OTLP_HEADERS
OTEL_EXPORTER_OTLP_METRICS_TIMEOUTOverride timeout (ms) for metrics export requests.OTEL_EXPORTER_OTLP_TIMEOUT
Per-signal overrides — Logs
VariableDescriptionDefault
OTEL_EXPORTER_OTLP_LOGS_PROTOCOLOverride transport protocol for logs.OTEL_EXPORTER_OTLP_PROTOCOL
OTEL_EXPORTER_OTLP_LOGS_HEADERSOverride HTTP headers for log export requests.OTEL_EXPORTER_OTLP_HEADERS
OTEL_EXPORTER_OTLP_LOGS_TIMEOUTOverride timeout (ms) for log export requests.OTEL_EXPORTER_OTLP_TIMEOUT
Zipkin
VariableDescriptionDefault
OTEL_EXPORTER_ZIPKIN_ENDPOINTBase URL of the Zipkin server. The /api/v2/spans path is appended automatically.http://localhost:9411
OTEL_EXPORTER_ZIPKIN_TIMEOUTExport timeout in milliseconds.10000
OTEL_EXPORTER_ZIPKIN_MAX_RETRIESNumber of retry attempts on transient failures.3
VariableDescriptionDefault
OTEL_TRACES_EXPORTERExporter driver for traces. Options: otlp, zipkin, console, memory, null.otlp
OTEL_METRICS_EXPORTERExporter driver for metrics. Options: otlp, console, memory, null.otlp
OTEL_LOGS_EXPORTERExporter driver for logs. Options: otlp, console, memory, null.otlp
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCEPreferred aggregation temporality for OTLP metrics. Options: Delta, Cumulative.SDK default
Head sampling
VariableDescriptionDefault
OTEL_TRACES_SAMPLER_PARENTWrap the sampler in a ParentBasedSampler so child spans follow the parent’s decision.true
OTEL_TRACES_SAMPLER_TYPEHead sampler type. Options: always_on, always_off, traceidratio.always_on
OTEL_TRACES_SAMPLER_TRACEIDRATIO_RATIOSampling ratio for the traceidratio sampler. 0.05 means 5% of traces are kept.0.05
Tail sampling
VariableDescriptionDefault
OTEL_TRACES_TAIL_SAMPLING_ENABLEDEnable tail sampling. When enabled, sampling decisions are deferred until the trace ends.false
OTEL_TRACES_TAIL_SAMPLING_DECISION_WAITMaximum time in milliseconds to wait for a trace to complete before making a decision.5000
OTEL_TRACES_TAIL_SAMPLING_RULE_KEEP_ERRORSEnable the built-in ErrorsRule that keeps traces containing error spans.true
OTEL_TRACES_TAIL_SAMPLING_RULE_SLOW_TRACESEnable the built-in SlowTraceRule that keeps traces exceeding the duration threshold.true
OTEL_TRACES_TAIL_SAMPLING_SLOW_TRACES_THRESHOLD_MSDuration threshold in milliseconds for the SlowTraceRule.2000
Application-level tail sampling is intended for single-service deployments. For multi-service tail sampling, use the OpenTelemetry Collector.
VariableDescriptionDefault
OTEL_WORKER_MODE_FLUSH_AFTER_EACH_ITERATIONFlush all telemetry after each request or job. When false, data is batched and flushed periodically.false
OTEL_WORKER_MODE_COLLECT_INTERVALMetrics collection and export interval in seconds when running in worker mode. Ignored when OTEL_WORKER_MODE_FLUSH_AFTER_EACH_ITERATION is true.60
Each variable enables or disables a specific instrumentation. Set to false to disable.
VariableInstrumentationDefault
OTEL_INSTRUMENTATION_HTTP_SERVERIncoming HTTP request tracingtrue
OTEL_INSTRUMENTATION_HTTP_CLIENTOutgoing HTTP request tracingtrue
OTEL_INSTRUMENTATION_QUERYDatabase query tracingtrue
OTEL_INSTRUMENTATION_QUEUEQueue job dispatch and execution tracingtrue
OTEL_INSTRUMENTATION_REDISRedis command tracingtrue
OTEL_INSTRUMENTATION_CACHECache operation eventstrue
OTEL_INSTRUMENTATION_EVENTLaravel event recordingtrue
OTEL_INSTRUMENTATION_VIEWView render tracingtrue
OTEL_INSTRUMENTATION_LIVEWIRELivewire component render tracingtrue
OTEL_INSTRUMENTATION_CONSOLEArtisan command tracingtrue
OTEL_INSTRUMENTATION_SCOUTLaravel Scout search operation tracingtrue

Build docs developers (and LLMs) love