An overnight Codex job made several failed requests. Was the model unavailable, a tool failing, or the logging pipeline broken? A terminal transcript mixes those questions together. Codex OpenTelemetry gives us structured events we can inspect independently—provided we do not turn our telemetry backend into an accidental copy of the repository.
This guide configures opt-in OTLP log export on the machine running Codex. It complements our agent monitoring guide, rather than replacing task progress checks. The collector setup is operator-managed infrastructure, not a built-in Office Claws integration.
Codex OpenTelemetry: choose the signal and destination
OpenAI's advanced configuration documentation, checked December 4, 2026, describes structured events for conversation starts, API requests, stream events, prompts, tool decisions and tool results. The otel.exporter setting controls log export. Trace and metrics exporters have separate settings; configuring logs alone does not configure all three pipelines.
| Signal | Useful question | Not proof of |
|---|---|---|
codex.api_request | Did a request succeed, and how long did it take? | The requested change being correct |
codex.tool_result | Did a tool report success, and how long did it run? | Required tests or review being complete |
| Conversation metadata | Which session, model and CLI version produced this event? | Authorization to deploy |
| Collector health | Are events being accepted and forwarded? | The agent making progress |
Start with logs from one disposable job. Pick a collector you operate or explicitly approve, with restricted access and a short retention period. A private endpoint is not enough by itself: review who can query the backend and where its backups go.
Run your first agent in about 3 minutes
Install the Office Claws CLI, connect your Contabo account and Codex subscription, and your agent gets its own VPS and a desk in the office.
curl -fsSL https://officeclaws.com/downloads/install.sh | sh$4.99/mo + your own Contabo VPS · keys stay in your keychain
Configure the VPS runner, not your laptop
Run codex --version as the account that actually launches jobs. Review the current configuration reference for that installed release. Codex normally uses ~/.codex/config.toml; a custom CODEX_HOME changes that location. Current documentation says project-local .codex/config.toml cannot set otel: put telemetry settings in the runner's user configuration, not the repository. Managed requirements can constrain these settings.
For an already-running OTLP/HTTP collector bound to loopback on the same VPS, merge this into the existing user configuration:
[otel]
environment = "vps-canary"
log_user_prompt = false
exporter = { otlp-http = { endpoint = "http://127.0.0.1:4318/v1/logs", protocol = "binary" } }This snippet does not install or start a collector. It assumes its HTTP logs receiver accepts protobuf at /v1/logs. Keep that receiver off public interfaces; a separate container's loopback address is not the host's loopback address. For a remote collector, use an approved HTTPS endpoint and the authentication configuration supported by your release. Do not copy this plaintext HTTP example across the internet.
Do not create a second [otel] table if one already exists. Review the merged configuration, inherited requirements and exporter destination before launching a real job. Our configuration profiles guide explains why a command working under one account says little about another runner.
Verify delivery without exposing real work
We test the boundary before using a production checkout:
- Start a disposable repository with no credentials, customer data or private source. Record the CLI version, start time and a local job identifier outside the agent-writable checkout.
- Ask Codex for a harmless explanation of a dummy file. Let the process shut down normally: the documented exporter batches asynchronously and flushes on shutdown.
- Check collector receiver and exporter diagnostics, then find the corresponding conversation and request events in the backend. Do not assume one visible event proves every event arrived.
- Inspect the actual exported attributes, including a tool event from a harmless file read. Set retention and filtering from the observed payload, not just the configuration names.
- In this disposable environment, temporarily make the collector unavailable. Confirm the supervisor can still record process exit and validation results, and that collector health reports the delivery problem. Restore the collector and verify a new canary run. Do not assume buffered events survive a crash or are replayed after an outage.
log_user_prompt = false redacts user prompt content; it is not a blanket guarantee of sanitized telemetry. Tool arguments, output snippets, paths, errors and identifying metadata may still be sensitive. Avoid secrets in test fixtures, review other logging options in your release, and allowlist or redact fields before forwarding. Collector-side filtering does not erase the fact that the local receiver already saw the raw event. See our secrets and environment guide for the separate credential-inheritance boundary.
Keep conversation identifiers in restricted logs when needed for investigation. Do not use prompt text, full paths or per-conversation IDs as unbounded metric labels. Even useful identifiers can create both privacy and cardinality problems.
Keep telemetry separate from completion and billing
An API failure with healthy collector delivery points toward a different investigation than an empty backend with an unhealthy collector. Both differ from a healthy agent that produces the wrong diff. Retain the job's base commit, candidate commit, exit status and required test results in an independent supervisor record. A missing event means missing evidence, not successful work; a successful tool event is not permission to merge.
Custom OTel export is also separate from Codex's built-in analytics. In current documentation, [analytics] enabled = false disables analytics and the built-in Statsig metrics exporter; it does not disable a custom OTLP metrics exporter. When retiring this logging experiment, set otel.exporter = "none", restart affected sessions, and check any separately configured trace or metrics exporters too. Verify that new exports stop. Already retained data still follows the collector/backend deletion policy.
Token observations are useful diagnostics, not an authoritative subscription-allowance meter or invoice. An always-on VPS does not remove ChatGPT-plan limits. Office Claws helps run and monitor Codex agents on your own VPS; the supported ChatGPT plan, VPS bill and Office Claws charge remain separate. Our subscription versus API cost guide explains that distinction.
Our recommendation: begin with one Codex VPS runner, one reviewed collector and one harmless canary. Prove what arrives, what stays private and what happens when delivery breaks before expanding to parallel overnight jobs. Telemetry should make failures easier to explain, not grant broader permissions or become a second source of secrets.