Not able to use env var for otlp headers in config
Open 💬 2 comments Opened Mar 12, 2026 by flexdinesh
What version of Codex CLI is running?
0.114.0
What subscription do you have?
Pro
Which model were you using?
GPT-5.4
What platform is your computer?
Arch Linux
What terminal emulator and version are you using (if applicable)?
Ghostty
What issue are you seeing?
I am able to set up and use OTEL config. But I want to pass shell environment variables to the header value. This example in the doc does not work now.
[otel]
exporter = { otlp-http = {
endpoint = "https://otel.example.com/v1/logs",
protocol = "binary",
headers = { "x-otlp-api-key" = "${OTLP_TOKEN}" }
}}
It works if I hardcode the token value.
What steps can reproduce the bug?
Try to use environment variable in OTEL config headers
What is the expected behavior?
OTEL config headers should be able to interpolate the value from shell environment variables
Additional information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗