OpenTelemetry for Codex CLI
Codex CLI can export traces, metrics, OTel log records with event names and attributes. With that telemetry, you can track API requests, tool invocations, token usage, MCP calls and run latency. This article walks through a local OpenTelemetry stack and Codex CLI configuration needed to send telemetry to it. The setup should help you explore the traces, logs and metrics, build dashboards and answer questions such as: Which models were used? How many tool calls were made? Was MCP used? How long did the run take? Traces While Codex CLI can export traces, its trace spans are not fully documented, and there is no official list of span names. ...