[codex] Trace exec-server JSON-RPC requests (#27466)

## Why

Exec-server JSON-RPC calls can cross local and remote transports, but
trace context stopped at the RPC boundary. That made client and server
work difficult to correlate when diagnosing latency or failures.

## What changed

- Propagate the current W3C trace context on outbound JSON-RPC requests.
- Parent inbound request spans from received trace context.
- Record the received JSON-RPC method on server spans and keep each span
open through response enqueue.
- Add only the OTEL dependencies required by the exec-server crate.

## Stack

Review and land this stack in order:

1. #27466 — trace exec-server JSON-RPC requests **(this PR)**
2. #27467 — record bounded connection, request, and process lifecycle
metrics
3. #27470 — observe remote registration and Noise rendezvous lifecycle

## Validation

- `just test -p codex-exec-server --lib` (153 passed)
- `just bazel-lock-check`
- `just fix -p codex-exec-server`
This commit is contained in:
richardopenai
2026-06-24 12:50:18 -07:00
committed by GitHub
Unverified
parent 4907f0c2c3
commit 74dcce594d
12 changed files with 306 additions and 15 deletions
+3
View File
@@ -5,6 +5,7 @@
use std::fmt;
use codex_protocol::protocol::W3cTraceContext;
use serde::Deserialize;
use serde::Serialize;
@@ -45,6 +46,8 @@ pub struct JSONRPCRequest {
pub method: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub params: Option<serde_json::Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub trace: Option<W3cTraceContext>,
}
/// A notification that does not expect a response.