Skip to content

exec-server: standardize JSON-RPC request spans#31687

Open
anp-oai wants to merge 1 commit into
mainfrom
codex/exec-server-rpc-span-fields
Open

exec-server: standardize JSON-RPC request spans#31687
anp-oai wants to merge 1 commit into
mainfrom
codex/exec-server-rpc-span-fields

Conversation

@anp-oai

@anp-oai anp-oai commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Why

app-server OTEL spans for RPC methods include a standard set of fields; exec-server should match, and every client request path should share the same span boundary.

What

  • Add rpc.system, rpc.method, and rpc.request_id to client and server request spans.
  • Record the bounded connection transport on server spans.
  • Centralize client request spans in call_inner, covering normal, timed, and cleanup calls without duplicate nesting.
  • Serialize the exec-server tracing tests that rebuild process-global callsite interest.
  • Preserve the existing span names and wire protocol.

Validation

  • just test -p codex-exec-server process_start_propagates_caller_trace_context_across_background_task (1 passed)
  • bazel test //codex-rs/exec-server:exec-server-unit-tests --runs_per_test=30 --nocache_test_results --test_output=errors (the tracing test passed 30/30; 11 aggregate runs failed only in unrelated relay/recovery timing tests under 30-way load)
  • just test -p codex-exec-server (306 passed, 2 skipped)
  • just fix -p codex-exec-server (clean)
  • just fmt (clean)

Stack

  1. #31687 (this PR, 1/5)
  2. #31690 (2/5)
  3. #31707 (3/5)
  4. #31729 (4/5)
  5. #31730 (5/5)

@anp-oai anp-oai changed the title exec-server: align JSON-RPC span attributes exec-server: align JSON-RPC span attributes with app-server Jul 9, 2026
@anp-oai anp-oai marked this pull request as ready for review July 9, 2026 02:05
@anp-oai anp-oai requested a review from a team as a code owner July 9, 2026 02:05
@anp-oai

anp-oai commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@anp-oai

anp-oai commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review for matching app-server's OTEL shape

Comment thread codex-rs/exec-server/src/rpc.rs Outdated

@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: 3b6a3e7004

ℹ️ 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/exec-server/src/rpc.rs
@anp-oai anp-oai force-pushed the codex/exec-server-rpc-span-fields branch from 3b6a3e7 to c671b06 Compare July 9, 2026 02:17
@anp-oai anp-oai changed the title exec-server: align JSON-RPC span attributes with app-server exec-server: standardize JSON-RPC request spans Jul 9, 2026
@anp-oai

anp-oai commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: c671b06d61

ℹ️ 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".

Align client and server spans with app-server's RPC attributes, centralize client span creation in call_inner so timed calls are traced, and serialize tracing tests that rebuild global callsite interest.
@anp-oai anp-oai force-pushed the codex/exec-server-rpc-span-fields branch from c671b06 to 1ecebbc Compare July 9, 2026 06:13
let _call_slot = self.acquire_regular_call_slot()?;
self.call_inner(method, params, RpcCallTimeout::None).await
let request_id = self.allocate_request_id();
self.call_inner(request_id, method, params, RpcCallTimeout::None)

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.

I think this drops telemetry for the two early admission failures: regular calls can return PendingRequestLimitExceeded before call_inner, and cleanup overflow closes the transport before reaching it too...
Both were inside the outer request spans before this change, so saturation is now exactly when this telemetry disappears

otel.kind = "server",
otel.name = span_name,
rpc.system = "jsonrpc",
rpc.method = method,

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: should rpc.method use the bounded routed span_name here?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants