mirror of
https://github.com/openai/codex.git
synced 2026-09-05 15:18:41 +00:00
Inline MCP UI URI metric emission
This commit is contained in:
@@ -96,7 +96,6 @@ mod telemetry;
|
||||
|
||||
use telemetry::McpCallMetricOutcome;
|
||||
use telemetry::emit_mcp_call_metrics;
|
||||
use telemetry::emit_mcp_ui_resource_uri_without_trusted_connector_id_metric;
|
||||
use telemetry::mcp_call_metric_outcome;
|
||||
use telemetry::record_mcp_call_outcome_span_telemetry;
|
||||
|
||||
@@ -173,9 +172,10 @@ pub(crate) async fn handle_mcp_tool_call(
|
||||
} else {
|
||||
"other"
|
||||
};
|
||||
emit_mcp_ui_resource_uri_without_trusted_connector_id_metric(
|
||||
turn_context.as_ref(),
|
||||
server_kind,
|
||||
turn_context.session_telemetry.counter(
|
||||
"codex.mcp.ui_resource_uri_without_trusted_connector_id",
|
||||
/*inc*/ 1,
|
||||
&[("server_kind", server_kind)],
|
||||
);
|
||||
}
|
||||
let app_tool_policy = if is_codex_apps_server {
|
||||
|
||||
@@ -10,8 +10,6 @@ use tracing::Span;
|
||||
const MCP_CALL_COUNT_METRIC: &str = "codex.mcp.call";
|
||||
const MCP_CALL_DURATION_METRIC: &str = "codex.mcp.call.duration_ms";
|
||||
const MCP_CALL_ERROR_COUNT_METRIC: &str = "codex.mcp.call.error";
|
||||
const MCP_UI_RESOURCE_URI_WITHOUT_TRUSTED_CONNECTOR_ID_METRIC: &str =
|
||||
"codex.mcp.ui_resource_uri_without_trusted_connector_id";
|
||||
// No CallToolResult was received. This includes request setup, transport, timeout, protocol, and
|
||||
// JSON-RPC failures; it does not imply that the request never reached the MCP server.
|
||||
const MCP_CALL_ERROR_TYPE_MCP_REQUEST: &str = "mcp_request";
|
||||
@@ -88,17 +86,6 @@ pub(super) fn emit_mcp_call_metrics(
|
||||
);
|
||||
}
|
||||
|
||||
pub(super) fn emit_mcp_ui_resource_uri_without_trusted_connector_id_metric(
|
||||
turn_context: &TurnContext,
|
||||
server_kind: &'static str,
|
||||
) {
|
||||
turn_context.session_telemetry.counter(
|
||||
MCP_UI_RESOURCE_URI_WITHOUT_TRUSTED_CONNECTOR_ID_METRIC,
|
||||
/*inc*/ 1,
|
||||
&[("server_kind", server_kind)],
|
||||
);
|
||||
}
|
||||
|
||||
fn mcp_call_metric_tags(
|
||||
status: &str,
|
||||
server_name: &str,
|
||||
|
||||
Reference in New Issue
Block a user