Extract OTEL trace WebSocket into a reusable crate (#42102)

## What changed

- Add `codex-otel-trace-websocket` with a `TraceWebSocket` API that owns the
  loopback OTLP receiver and WebSocket listener.
- Bind both listeners during startup, expose the exporter and bound listener
  addresses, and surface listener failures through a single lifecycle method.
- Update `codex-code-mode-host` to use the new crate and shut down the bridge
  after flushing its trace provider.

GitOrigin-RevId: ec5ca4c4369b6b3b1232875c2699730eb748ab1c
This commit is contained in:
Adam Perry @ OpenAI
2026-09-01 17:17:45 +00:00
committed by copyberry
parent 8ea297ff60
commit 9969043b95
9 changed files with 234 additions and 199 deletions
-6
View File
@@ -49,14 +49,8 @@ mod delegate;
mod grpc;
mod grpc_transport;
mod peer;
mod trace_transport;
mod transport;
pub use self::trace_transport::bind_otlp_trace_receiver;
pub use self::trace_transport::run_otel_trace_listener;
pub use self::trace_transport::run_otlp_trace_receiver;
pub use self::trace_transport::trace_batch_channel;
const MAX_IN_FLIGHT_REQUESTS: usize = 256;
const MAX_ACTIVE_CELLS: usize = 128;
const MAX_RECENT_REQUEST_IDS: usize = 4096;