Open
Conversation
This was referenced Mar 25, 2026
c6b4fbf to
a445016
Compare
owenlin0
reviewed
Mar 26, 2026
codex-rs/core/src/mcp_tool_call.rs
Outdated
| tag_refs.as_slice() | ||
| } else { | ||
| status_only_tags.as_slice() | ||
| }; |
Collaborator
There was a problem hiding this comment.
this is pretty messy. looks like this complexity is due to conditionally applying tags. for codex.mcp.call, can we always tag it with status, tool, connector_id, connector_name?
Collaborator
There was a problem hiding this comment.
and reuse the same tags for both metrics?
Contributor
Author
There was a problem hiding this comment.
It was done to not pollute metrics for tool calls that didn't execute declines/safety/other, but agree it just makes things messy. I'll just skip the duration metric if we didn't execute and keep the tags the same (with status) otherwise
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
6edc5e7 to
1b8fc07
Compare
Co-authored-by: Codex <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
codex.mcp.callwithtool,connector_id, and sanitizedconnector_namefor actual MCP executionscodex.mcp.call.duration_msfor actual MCP executions so connector-level latency is visible in metricscodex.mcp.callcounterIncluded Changes
codex-rs/core/src/mcp_tool_call.rs: add connector-sliced MCP count and duration metrics only for executed tool calls, while leaving non-executed outcomes as status-only countscodex-rs/core/src/mcp_tool_call_tests.rs: cover metric tag shaping, connector-name sanitization, and the new duration metric tagsTesting
cargo test -p codex-corejust fix -p codex-corejust fmtNotes
cargo test -p codex-corestill hits existing unrelated failures in approvals-reviewer config tests and the sandboxed JS REPLmktemptestcargo testwas not run