Skip to content

[codex] Add OTEL counter descriptions#26091

Merged
richardopenai merged 2 commits into
mainfrom
codex/otel-metric-instruments
Jun 8, 2026
Merged

[codex] Add OTEL counter descriptions#26091
richardopenai merged 2 commits into
mainfrom
codex/otel-metric-instruments

Conversation

@richardopenai

@richardopenai richardopenai commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Why

Metric descriptions should be declared with reusable OTEL instruments instead of being coupled to individual consumers. Counter descriptions are the smallest API primitive needed by the exec-server observability work.

What changed

  • Adds counter_with_description while preserving the existing counter API.
  • Caches counters by name and description so instrument metadata remains part of the declaration identity.
  • Covers the exported description together with the existing value and attribute contract.

This PR only adds counter descriptions. It does not add gauges, second-based durations, or exec-server adoption.

Stack

  1. [codex] Add OTEL counter descriptions #26091: counter descriptions
  2. [codex] Add reusable OTEL gauge instruments #27057: gauge instruments
  3. [codex] Add second-based OTEL duration histograms #27058: second-based duration histograms

Related independent coverage: #27059 tests OTLP HTTP log and trace event export.

The codex-exec-server bounded service tag now stays with the exec-server adoption change instead of this reusable infrastructure stack.

Validation

  • just test -p codex-otel
  • just fix -p codex-otel
  • just fmt

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6a531cb985

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/otel/src/metrics/client.rs
Comment thread codex-rs/otel/src/metrics/client.rs Outdated
@richardopenai richardopenai force-pushed the codex/otel-metric-instruments branch from ff23345 to 4b17850 Compare June 8, 2026 20:57
@richardopenai richardopenai changed the title [codex] Add reusable OTEL metric instruments [codex] Add OTEL counter descriptions Jun 8, 2026
Comment thread codex-rs/otel/src/metrics/client.rs Outdated
const DURATION_UNIT: &str = "ms";
const DURATION_DESCRIPTION: &str = "Duration in milliseconds.";

type InstrumentKey = (String, Option<String>);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: Could this be its own struct with named fields? All the traits that matter should be derive-able.

@richardopenai richardopenai force-pushed the codex/otel-metric-instruments branch from 4b17850 to a107f7b Compare June 8, 2026 21:19
@richardopenai richardopenai enabled auto-merge (squash) June 8, 2026 22:25
@richardopenai richardopenai merged commit feca160 into main Jun 8, 2026
31 checks passed
@richardopenai richardopenai deleted the codex/otel-metric-instruments branch June 8, 2026 22:29
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants