Expand description
Prometheus metrics for the MCP HTTP endpoints.
Tracks request counts, tool call counts, and tool call durations,
labeled by endpoint type (agent / developer) and either the
JSON-RPC method name or the MCP tool name. The status label is one of
the McpCallStatus variants: ok, a lifecycle outcome, or the
McpRequestError error type (e.g. ToolNotFound) for failures.
Structs§
- McpMetrics
- Metrics emitted by the MCP HTTP handlers.
- Tool
Call Guard - RAII guard for a single
tools/callinvocation. On drop, incrementstool_calls_totalwith the current status and observestool_call_duration_secondsvia the embeddedHistogramTimer’s own drop. Designed so that if the surrounding future is dropped before completion (e.g. bytokio::time::timeout), the metric still records with the default"cancelled"status instead of being silently lost.
Enums§
- McpCall
Status - Closed set of outcomes recorded in the MCP
statuslabel. Keeping these as an enum (rather than free-form strings at the call sites) pins the metric’s label cardinality and stops typos from silently creating new label values. Mirrorsoauth_metadata::MetricStatus.