For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Copy to LLMGithubGo to App
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
    • Overview
  • TypeScript
    • Opik TypeScript SDK
  • Python
    • Opik Python SDK
    • OpenTelemetry Python SDK
  • Java
    • Spring AI
    • Quarkus LangChain4j
  • .NET
  • Ruby
    • OpenTelemetry Ruby SDK
  • No-Code
    • Cursor
    • Dify
    • Flowise
    • Langflow
    • n8n
    • OpenClaw
    • OpenAI Codex
    • OpenWebUI
    • Prompt Flow
  • Multi-Language
    • OpenTelemetry
LogoLogo
Copy to LLMGithubGo to App
On this page
  • When this guide applies
  • Where to configure Codex
  • Opik OTLP trace endpoint modes
  • Example intent and minimal valid setup
  • Validation
  • Notes
  • Source references
No-Code

Observability for OpenAI Codex with Opik

Was this page helpful?
Previous

Observability for OpenWebUI with Opik

Next
Built with

OpenAI Codex supports opt-in OpenTelemetry export through Codex configuration files.

When this guide applies

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]).

Where to configure Codex

Codex reads configuration from:

  • user config: ~/.codex/config.toml
  • project config: .codex/config.toml

See Codex config basics.

Opik OTLP trace endpoint modes

For Opik OTEL endpoint behavior, see Opik OpenTelemetry overview.

Opik Cloud
Enterprise deployment
Self-hosted instance
1[otel]
2# Optional environment label in Codex telemetry
3trace_exporter = "otlp-http"
4environment = "prod"
5log_user_prompt = false
6
7[otel.trace_exporter.otlp-http]
8endpoint = "https://www.comet.com/opik/api/v1/private/otel/v1/traces"
9protocol = "binary"
10headers = { "Authorization" = "<your-api-key>", "Comet-Workspace" = "<your-workspace>", "projectName" = "<your-project-name>" }

Required headers:

  • Authorization
  • Comet-Workspace

Optional headers:

  • projectName (recommended)

Example intent and minimal valid setup

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)
  • endpoint
  • protocol (binary or json, binary recommended)

Optional fields:

  • headers (projectName strongly recommended)
  • otel.environment
  • otel.log_user_prompt (keep false unless policy allows prompt export)

Minimal valid config:

1[otel]
2trace_exporter = "otlp-http"
3log_user_prompt = false
4
5[otel.trace_exporter.otlp-http]
6endpoint = "https://www.comet.com/opik/api/v1/private/otel/v1/traces"
7protocol = "binary"
8headers = { "Authorization" = "<your-api-key>", "Comet-Workspace" = "<your-workspace>", "projectName" = "<your-project-name>" }

Validation

  1. Run a Codex session after updating config.toml.
  2. Confirm OTLP HTTP requests are sent to /otel/v1/traces.
  3. Verify traces appear in the expected Opik workspace/project.

Notes

  • Codex telemetry export is opt-in.
  • Keep log_user_prompt = false unless your policy explicitly allows prompt text export.
  • If your Codex build uses a different exporter key path, align with your installed version’s config reference.

Source references

  • Codex security and OTEL opt-in
  • Codex config basics
  • Codex config reference
  • Opik OpenTelemetry overview