OpenAI logoOpenAI Codex ยท OpenTelemetry

OpenAI Codex OpenTelemetry

A practical guide to Codex telemetry: available metrics, events and traces, configuration, privacy considerations, and what engineering teams can learn from the data.

Updated September 2026 ยท 12 min read

OpenAI logo

Codex

AI coding agent

OpenTelemetry logo

OpenTelemetry

Instrumentation

Signals

  • Metrics
  • Events
  • Traces

Compatible backend

Your observability stack

Quick answer

What is OpenAI Codex OpenTelemetry?

Codex includes native OpenTelemetry support for exporting telemetry about AI-assisted development and agent execution. Depending on the Codex execution mode and configuration, telemetry can include metrics, structured events and distributed traces.

These signals provide visibility into areas such as conversations, model requests, token usage, tool execution, approvals, performance and other agent activity.

OpenTelemetry logo

In short: OpenTelemetry makes supported Codex agent activity observable outside Codex itself.

Telemetry signals

What Telemetry Does Codex Provide?

Codex uses OpenTelemetry to expose complementary signals about AI-agent usage and execution.

  • Available

    Metrics

    Quantitative telemetry covering supported usage, token and execution measurements, exported through the otel.metrics_exporter setting.

  • Available

    Events

    Structured events describing supported Codex activity including model requests, user interactions, tool execution and approval decisions.

  • Available

    Traces

    Distributed traces providing visibility into operations across supported Codex agent workflows, configured with otel.trace_exporter.

Telemetry availability can differ between Codex execution modes and versions. Always refer to the current Codex documentation for mode-specific support.

Telemetry reference

What Data Can Codex Export?

Codex telemetry can expose multiple dimensions of an AI-agent session, from model requests to tool execution and token consumption. Identifiers below come from OpenAI's Codex configuration reference and the openai/codex repository.

Codex OpenTelemetry data categories, official identifiers and what they help observe
Data categorySignalOfficial identifierWhat it helps observe
ConversationsEventcodex.conversation_startsCodex conversation and session activityEmitted when a Codex conversation starts, with session-scoped metadata.
Model requestsEvent ยท Metriccodex.api_requestRequests made to supported AI modelsEmitted as a log event and as a counter, with codex.api_request.duration_ms recording request duration. Streamed responses are reported through codex.sse_event.
Token usageMetriccodex.turn.token_usageInput, output and supported token consumptionPer-turn token usage. Related counters include codex.usage.total_tokens and codex.usage.reasoning_output_tokens.
Tool callsMetriccodex.tool.callTools invoked by Codex during agent executionCounter for tool calls, with codex.tool.call.duration_ms for latency and codex.turn.tool.call for per-turn counts.
Tool resultsEventcodex.tool_resultOutcomes of supported tool executionsResult event emitted after a tool execution completes; exported content is governed by Codex's tool result log configuration.
Approval decisionsEventcodex.tool_decisionDecisions associated with tool permissions and executionRecords the decision taken for a tool invocation, including its source. Sandbox outcomes are reported through codex.sandbox_outcome.
PerformanceMetriccodex.turn.ttft.duration_msTiming and supported latency signalsTime to first token per turn, alongside codex.turn.e2e_duration_ms, codex.sse_event.duration_ms and codex.startup_phase.
Agent activityEventcodex.user_promptSupported operations performed during Codex workflowsUser input events and related activity such as codex.turn_cost, codex.auth_recovery and websocket events. Prompt text is only included when otel.log_user_prompt is enabled.

Common attributes

  • otel.environment

    Environment tag applied to emitted OpenTelemetry events. Default: dev.

  • service.name

    Service identity of the Codex client emitting telemetry, for example codex-cli.

  • otel.span_attributes

    Static attributes applied to exported trace spans.

  • otel.tracestate

    W3C tracestate members propagated with exported trace context.

Use cases

What Can Engineering Teams Learn From Codex Telemetry?

Codex telemetry can help engineering organizations answer questions about adoption, AI consumption, tools and agent reliability.

  • Adoption & Usage

    Understand how Codex usage evolves across engineering workflows by analyzing supported sessions and agent activity over time.

  • AI Consumption

    Analyze model requests and token consumption to better understand how AI resources are being used.

  • Tools & Agent Workflows

    Observe how Codex invokes tools, handles approvals and executes tasks across agentic development workflows.

  • Performance & Reliability

    Use supported timing, request and execution telemetry to investigate agent performance and operational issues.

    Usage and activity metrics provide context about AI-assisted development. They should not be treated as standalone measures of developer productivity.

How it works

How Codex OpenTelemetry Works

Codex can generate OpenTelemetry telemetry and export supported signals through OTLP to compatible observability infrastructure.

OpenAI logo

Codex

OpenTelemetry logo

OpenTelemetry

  • Metrics
  • Events
  • Traces

OTLP

HTTP or gRPC

Collector or compatible backend

Read the official Codex documentation

Configuration

How to Enable OpenTelemetry in Codex

OpenTelemetry export is disabled by default and can be configured through Codex configuration. The [otel] table selects exporters, endpoints, protocols, headers and prompt-logging behavior.

# ~/.codex/config.toml
[otel]
environment = "production"
log_user_prompt = false

# Logs and events exporter
exporter = "otlp-http"

[otel.exporter.otlp-http]
endpoint = "https://otlp.example.com"
protocol = "binary"
headers = { "Authorization" = "Bearer ${OTLP_TOKEN}" }

# Traces exporter
trace_exporter = "otlp-http"

[otel.trace_exporter.otlp-http]
endpoint = "https://otlp.example.com"
protocol = "binary"

# Metrics exporter
metrics_exporter = "otlp-http"

Keep telemetry disabled or restrict exported content when observability is not required.

View advanced configuration
  • otel.exporter โ€” none | otlp-http | otlp-grpc โ€” selects the exporter used for OpenTelemetry logs and events.
  • otel.trace_exporter โ€” none | otlp-http | otlp-grpc โ€” selects the trace exporter and its endpoint metadata.
  • otel.metrics_exporter โ€” none | statsig | otlp-http | otlp-grpc โ€” selects the metrics exporter. Defaults to statsig.
  • otel.exporter.<id>.protocol โ€” binary | json โ€” protocol used by the OTLP/HTTP exporter.
  • otel.exporter.<id>.headers โ€” Static headers included with OTLP exporter requests, such as an authorization token.
  • otel.exporter.<id>.tls.* โ€” ca-certificate, client-certificate and client-private-key paths for exporter TLS.
  • otel.log_user_prompt โ€” Boolean opt-in for exporting raw user prompts with OpenTelemetry logs.
  • otel.environment โ€” Environment tag applied to emitted OpenTelemetry events. Default: dev.
  • Config placement โ€” OpenAI documents that otel keys are ignored in a project-local .codex/config.toml โ€” telemetry keys belong in user-level configuration.

The complete key list is documented in OpenAI's Codex configuration reference.

Privacy

Privacy and Sensitive Data

Coding-agent telemetry can contain detailed information about development workflows. Codex provides configuration controls that organizations should review before exporting telemetry.

  • User Prompts

    Prompt text should not be treated as required telemetry. Codex provides the otel.log_user_prompt setting, an explicit opt-in for exporting raw user prompts with OpenTelemetry logs.

  • Tool Activity

    Tool execution telemetry can contain information about development workflows and should be handled according to organizational security and privacy policies.

  • Telemetry Destination

    OpenTelemetry export allows organizations to send supported Codex telemetry to their chosen compatible infrastructure, including TLS settings and static headers per exporter.

Good practice: Keep prompt logging disabled unless prompt content is explicitly required for a defined observability use case. Collect the minimum telemetry required for the questions your organization wants to answer.

From telemetry to analytics

OpenTelemetry Gives You the Data. What Do You Do With It?

Codex can provide detailed telemetry about model usage, tokens, tools and agent execution. But raw telemetry does not automatically explain how AI-assisted development is evolving across an engineering organization.

These signals need to be structured and interpreted to reveal broader patterns around adoption, AI consumption, agent workflows and engineering activity.

Turn Codex Telemetry Into Engineering Intelligence

helloMetry transforms supported AI coding telemetry into structured analytics designed to help engineering organizations understand how AI agents are being adopted and used.

  • Adoption
  • AI Consumption
  • Agent Activity
  • Workflows
Explore Codex with helloMetry

Explore Other OpenTelemetry Integrations

  • Claude logo

    Claude Code

    Claude Code OpenTelemetry: metrics, events and traces, configuration and privacy considerations.

    Read the guide
  • Google Gemini logo

    Gemini CLI

    Gemini CLI OpenTelemetry: available metrics, logs and traces, setup and privacy considerations.

    Read the guide
  • GitHub Copilot logo

    GitHub Copilot

    GitHub Copilot OpenTelemetry: agent metrics, events and traces, setup and privacy considerations.

    Read the guide
  • Cursor logo

    Cursor

    Cursor OpenTelemetry: exported metrics and logs, destination setup and privacy considerations.

    Read the guide
  • Qwen logo

    Qwen Code

    Qwen Code OpenTelemetry: metrics, logs and traces, OTLP setup and privacy considerations.

    Read the guide

FAQ

Frequently Asked Questions

Does OpenAI Codex support OpenTelemetry?

Yes. Codex includes native OpenTelemetry support for exporting supported observability data to compatible infrastructure.

What telemetry can Codex export?

Depending on the execution mode and current Codex version, OpenTelemetry can provide metrics, structured events and traces covering areas such as model requests, token consumption, tools, approvals and agent execution.

Can Codex token usage be monitored?

Yes. Supported Codex telemetry provides token-usage information that can be used to analyze AI consumption.

Can Codex tool activity be monitored?

Yes. Codex emits supported telemetry about tool execution and tool results, providing visibility into how tools participate in agent workflows.

Does Codex export OpenTelemetry traces?

Yes. Supported Codex execution modes can export distributed traces through OpenTelemetry.

Are Codex prompts exported through OpenTelemetry?

Prompt logging is configurable. Organizations should review Codex's current telemetry configuration and avoid exporting prompt content unless it is explicitly required.

Does helloMetry replace OpenTelemetry?

No. OpenTelemetry provides the standard used to collect and export telemetry. helloMetry uses supported telemetry to transform AI coding-agent data into engineering analytics.

Sources & further reading

Primary technical source: OpenAI, for all Codex-specific behavior

OpenAI โ€” Codex configuration reference

Official repository

openai/codex โ€” codex-otel

Standard

OpenTelemetry documentation