From 225614d7fbbcc1c32f8e943e9413624b01df1159 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Fri, 9 Jan 2026 13:09:21 +0000 Subject: [PATCH] chore: add mcp call metric (#8973) --- codex-rs/core/src/mcp_tool_call.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/codex-rs/core/src/mcp_tool_call.rs b/codex-rs/core/src/mcp_tool_call.rs index 516641037..6066c1512 100644 --- a/codex-rs/core/src/mcp_tool_call.rs +++ b/codex-rs/core/src/mcp_tool_call.rs @@ -72,6 +72,12 @@ pub(crate) async fn handle_mcp_tool_call( notify_mcp_tool_call_event(sess, turn_context, tool_call_end_event.clone()).await; + let status = if result.is_ok() { "ok" } else { "error" }; + turn_context + .client + .get_otel_manager() + .counter("codex.mcp.call", 1, &[("status", status)]); + ResponseInputItem::McpToolCallOutput { call_id, result } }