Codex
Add an [otel] section to your Codex config to ship session telemetry — prompts, tool calls, and model API requests — to Sazabi via Codex's built-in OTLP exporter.
About
Ship Codex CLI session telemetry to Sazabi using Codex's built-in OTLP exporter. Once configured, every session emits structured events covering user prompts, tool decisions, tool results, and model API requests — no code changes to your projects required.
Events include attributes like codex.user_prompt, codex.tool_decision, codex.tool_result, and codex.api_request, along with prompt, model, conversation.id, user.email, and originator.
Enabling log_user_prompt = true exports raw prompt text, including any
sensitive content typed during sessions. Only enable it when you understand
the privacy implications for your team.
Prerequisites
- Codex CLI installed and running
- Your Sazabi intake URL, shown above — open the log source and copy the Intake URL from its setup screen (the public key is embedded in the URL)
Set up in the dashboard
Add the OTLP exporter to your Codex config
Open or create ~/.codex/config.toml and add (or merge with) the [otel] section:
[otel]
log_user_prompt = false
[otel.exporter.otlp-http]
endpoint = "<your intake URL>/v1/logs"
protocol = "binary"Replace <your intake URL> with the intake URL shown above. Codex requires the full logs URL including the /v1/logs path suffix — it does not append the path itself.
Leave the metrics exporter at its default. Codex metrics are not ingested yet; pointing them at Sazabi only ships traffic that intake discards.
Restart Codex
Codex loads its configuration at startup. Quit and relaunch Codex for the new settings to take effect.
Set up with the CLI
You can also register the Codex log source with the Sazabi CLI (installed and authenticated — see CLI reference).
Registering the source mints the same intake URL the dashboard shows above (the public key is embedded in its hostname):
sazabi log-sources create codex --mode connectionlessThe command prints the intake URL for the new source — copy the whole URL and point your sender at it using the configuration shown above. Run sazabi log-sources get <log-source-id> at any time to reprint the endpoint, or sazabi log-sources list to see every log source in the project.
Verify
Start a Codex session and run a prompt. Open the Intake page in the Sazabi dashboard and confirm events from the Codex source appear within a minute or two.
Start a thread and search for codex.api_request to find model API requests, or search for conversation.id to view all events from a single conversation.
Troubleshooting
No events after restarting — Confirm ~/.codex/config.toml is valid TOML and the [otel.exporter.otlp-http] section is correctly nested. Check for syntax errors such as mismatched quotes or missing brackets.
Events appear but prompts are missing — log_user_prompt must be true for prompt text to be included. If privacy is a concern, set it to false — session structure and API metadata are still exported.
Endpoint URL format — Codex requires the full endpoint URL including /v1/logs. If you omit the path suffix, Codex will not append it automatically and events will not reach the correct intake path.
Codex metrics are not stored — Only OTLP log events are ingested. Metric events from Codex are not stored by this source.