Trace remote exec-server connection setup (#35275)

## What changed

- Preserve the current tracing span and subscriber when lazy remote environment
  startup runs in a background task.
- Add spans for the remote connection, environment registry, Noise, and
  rendezvous WebSocket stages, including relevant environment and registration
  identifiers.
- Propagate the current trace context to environment registry connection and
  harness-key validation requests.

GitOrigin-RevId: 0044c3eb94d59c6a6b92752d3d372195be4adb81
This commit is contained in:
rphilizaire-openai authored and copyberry committed 2026-07-25 01:39:17 +00:00
1 parent 25b6fc9bbc
commit c3e926e61c
3 files changed
+41 -4

No files matched your search

@@ -170,6 +170,7 @@ impl ExecServerClient {
.await
}
#[tracing::instrument(name = "codex.exec_server.remote.noise.connect", skip_all)]
async fn open_initial_noise_rendezvous_connection(
provider: &Arc<dyn NoiseRendezvousConnectProvider>,
identity: &NoiseChannelIdentity,
@@ -285,6 +286,16 @@ impl ExecServerClient {
Self::connect(connection, options).await
}
#[tracing::instrument(
name = "codex.exec_server.remote.noise.websocket_connect",
skip_all,
fields(
otel.kind = "client",
otel.name = "codex.exec_server.remote.noise.websocket_connect",
environment_id = %args.bundle.environment_id,
executor_registration_id = %args.bundle.executor_registration_id,
)
)]
pub(crate) async fn open_noise_rendezvous_connection(
args: NoiseRendezvousConnectArgs,
) -> Result<(JsonRpcConnection, ExecServerClientConnectOptions), ExecServerError> {