Skip to content

Environment variables

Every supported override begins with RFC6035_2OTEL_. Convert a YAML nesting boundary to __ and preserve single underscores in a field name. Environment overrides have the highest configuration precedence.

YAML keyEnvironment variable
listen.addressRFC6035_2OTEL_LISTEN__ADDRESS
listen.portRFC6035_2OTEL_LISTEN__PORT
otlp.endpointRFC6035_2OTEL_OTLP__ENDPOINT
otlp.protocolRFC6035_2OTEL_OTLP__PROTOCOL
otlp.headers.<header>RFC6035_2OTEL_OTLP__HEADERS__<HEADER>
dedupe_windowRFC6035_2OTEL_DEDUPE_WINDOW
log.levelRFC6035_2OTEL_LOG__LEVEL
service.nameRFC6035_2OTEL_SERVICE__NAME
service.versionRFC6035_2OTEL_SERVICE__VERSION

For example:

export RFC6035_2OTEL_OTLP__ENDPOINT="https://collector.example.test"
export RFC6035_2OTEL_OTLP__HEADERS__AUTHORIZATION="Bearer replace-me"
export RFC6035_2OTEL_LISTEN__PORT="5060"

senders is a structured list and cannot be represented by the flat environment mapping. Keep it in YAML. Unknown environment keys fail rather than being ignored, so a misspelled secret variable cannot silently select unexpected defaults.

Standard OpenTelemetry resource environment

OTEL_RESOURCE_ATTRIBUTES is also read and attached to both metrics and logs. Use it for standard resource dimensions that are not application configuration, for example:

export OTEL_RESOURCE_ATTRIBUTES="deployment.environment.name=production"

The configured service.name and service.version, plus the runtime service.instance.id, override those same keys from the OpenTelemetry environment. OTEL_SERVICE_NAME is therefore accepted by the SDK but the explicit configured service name remains authoritative. Telemetry SDK and host resource attributes are added automatically.