OpenAI Codex supports opt-in OpenTelemetry export through Codex configuration files.
Use this guide if you run Codex (CLI/IDE/app) and want its OTEL trace exporter to send telemetry to Opik.
The block structure below follows the current Codex runtime config shape used in local config.toml ([otel.trace_exporter.otlp-http]).
Codex reads configuration from:
~/.codex/config.toml.codex/config.tomlSee Codex config basics.
For Opik OTEL endpoint behavior, see Opik OpenTelemetry overview.
Required headers:
AuthorizationComet-WorkspaceOptional headers:
projectName (recommended)Intent: Route Codex OTEL trace export to Opik with project/workspace attribution.
Applies when: You have enabled Codex OTEL export and selected OTLP/HTTP exporter in config.
Required fields:
trace_exporter = "otlp-http" under [otel]otel.trace_exporter exporter block (otlp-http)endpointprotocol (binary or json, binary recommended)Optional fields:
headers (projectName strongly recommended)otel.environmentotel.log_user_prompt (keep false unless policy allows prompt export)Minimal valid config:
config.toml./otel/v1/traces.log_user_prompt = false unless your policy explicitly allows prompt text export.