Skip to content

[codex] Expose service tier and reasoning effort in OTEL - #29155

Merged
daniel-oai merged 1 commit into
mainfrom
daniels/add-fast-mode-otel-log
Jun 23, 2026
Merged

[codex] Expose service tier and reasoning effort in OTEL#29155
daniel-oai merged 1 commit into
mainfrom
daniels/add-fast-mode-otel-log

Conversation

@daniel-oai

Copy link
Copy Markdown
Contributor

Summary

NVIDIA asked to measure Fast mode usage and reasoning effort from Codex CLI OTEL logs. Add the finalized service_tier and model_reasoning_effort to the existing codex.sse_event response.completed record.

This intentionally reuses the existing completion event and leaves transport APIs and shared telemetry plumbing unchanged.

Testing

  • cargo build -p codex-cli --bin codex
  • just test -p codex-core responses_api_emits_api_request_event
  • End-to-end with the built CLI and a local OTLP/HTTP collector:
    • Fast/high emitted service_tier=priority and model_reasoning_effort=high with token usage.
    • Standard/low omitted service_tier and emitted model_reasoning_effort=low with token usage.

model: model.to_owned(),
slug: slug.to_owned(),
service_tier: None,
model_reasoning_effort: None,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we populate these values upstream? service_tier and model_reasoning_effort are thread-level settings, similar to model

that way we can get rid of with_inference_request

Comment thread codex-rs/core/src/client.rs
@daniel-oai
daniel-oai merged commit e0ac5d3 into main Jun 23, 2026
31 checks passed
@daniel-oai
daniel-oai deleted the daniels/add-fast-mode-otel-log branch June 23, 2026 03:44
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants