Skip to content

[codex] Record exec-server connection metrics#27467

Open
richardopenai wants to merge 1 commit into
codex/exec-server-rpc-tracingfrom
codex/exec-server-connection-metrics
Open

[codex] Record exec-server connection metrics#27467
richardopenai wants to merge 1 commit into
codex/exec-server-rpc-tracingfrom
codex/exec-server-connection-metrics

Conversation

@richardopenai

@richardopenai richardopenai commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Record bounded active and accepted connection metrics for relay, stdio, and WebSocket transports.

Stack

Validation

  • just test -p codex-exec-server --lib (112 passed)

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Review source: Codex Cloud Agents (CCA)

Codex Cloud Agents (CCA) couldn't complete this review. The original Codex Review is unaffected.

@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: d6b943d92c

ℹ️ 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 on lines +70 to +78
let active = inner
.connection_counter(transport)
.fetch_add(1, Ordering::AcqRel)
+ 1;
inner.gauge(
CONNECTIONS_ACTIVE_METRIC,
CONNECTIONS_ACTIVE_DESCRIPTION,
active,
&[("transport", transport.metric_tag())],

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.

P2 Badge Serialize active connection gauge updates

When two connections of the same transport start or finish concurrently, the atomic counter update and the gauge recording can be reordered: e.g. one disconnect computes active = 1, another computes and records 0, then the first records stale 1, leaving exec_server_connections_active overreported until another event. Please make the active gauge observe the atomic value at collection time or protect the update+record sequence so the emitted value cannot go backwards after a newer count was recorded.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant