mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Add WebSocket connection metrics with reauthentication labels (#59018)
## What changed - Record connection attempts and durations as `codex.websocket.connect` and `codex.websocket.connect.duration_ms`, labeled with `success`, `reauth`, and the configured `product_sku` when present. - Detect reauthentication by comparing the current auth revision with the last successful connection, preserving that revision across connection resets. Include `auth.reauth` in connection logs and traces. - Populate session telemetry with the configured product SKU. ## Testing Extend tests to check reauthentication labels after account switches, product SKU labels for restored sessions, and failed-handshake counts, durations, and labels. GitOrigin-RevId: 53a38b4460ab9021058dfe2fe104d0441993b18a
This commit is contained in:
@@ -1396,6 +1396,7 @@ impl Session {
|
||||
session_configuration.session_source.clone(),
|
||||
)
|
||||
.with_auth_env(auth_env_telemetry.to_otel_metadata())
|
||||
.with_product_sku(config.apps_mcp_product_sku.as_deref())
|
||||
.with_user_id(telemetry_auth.and_then(CodexAuth::get_chatgpt_user_id))
|
||||
.with_tool_result_log_config(config.otel.tool_result);
|
||||
if !config.otel.log_sse_deltas {
|
||||
|
||||
Reference in New Issue
Block a user