Send OpenAI Codex Telemetry to KloudMate
Codex can export OpenTelemetry traces and log events for every session. Add exporters to your Codex config and point them at KloudMate to see each Codex turn in AI Observability with its model calls, tool calls, tokens, and estimated cost.
Prerequisites
Section titled “Prerequisites”- A KloudMate API key, from Settings → Ingest Keys.
- The Codex CLI or IDE extension, configured through
~/.codex/config.toml.
Add the exporters
Section titled “Add the exporters”Add an [otel] section to ~/.codex/config.toml. Codex ignores [otel] in a project’s .codex/config.toml, so it must go in the file in your home directory.
trace_exportersends the traces that AI Observability reads. It’s off unless you set it.exportersends Codex’s log events, such as API requests and tool decisions, to KloudMate Logs. It’s optional.- Each endpoint takes the full path for its signal (
/v1/tracesor/v1/logs), andprotocolis required.
KloudMate expects the raw API key in the Authorization header, with no Bearer prefix. Restart Codex after you edit the file.
Prompts and responses
Section titled “Prompts and responses”Codex writes prompts and responses to log events only, not to spans, so the conversation view in AI Observability stays empty for Codex runs. User prompts are redacted even in the log events unless you add log_user_prompt = true to the [otel] section.
Known limitations
Section titled “Known limitations”- Codex doesn’t set a status on its spans, so a request that fails without a response isn’t counted as an error, and its turn shows as completed.
- Codex sends its spans in several batches. Latency for the last model call in a turn can read low, and that call can be missing its provider.
Check the data
Section titled “Check the data”Run one prompt in Codex, then open AI Observability → Traces. The turn appears as Codex Turn, grouped with the rest of its session, with its model, steps, tokens, and estimated cost.