Skip to main content

Module metrics

Module metrics 

Source
Expand description

Prometheus metrics registry shared across server components. Prometheus metrics for MCP servers.

Provides a shared crate::metrics::McpMetrics registry with standard HTTP counters. The transport layer exposes these via a /metrics endpoint on a dedicated listener when metrics_enabled is true.

§Public surface and the prometheus crate

crate::metrics::McpMetrics::registry and the IntCounterVec / HistogramVec fields are intentionally exposed so downstream crates can register additional custom collectors against the same registry. This re-exports the prometheus crate types as part of rmcp-server-kit’s public API; pin the same major version to avoid type-identity mismatches when registering custom metrics.

Structs§

McpMetrics
Collected Prometheus metrics for an MCP server.

Functions§

serve_metrics
Spawn a dedicated HTTP listener that serves Prometheus metrics on /metrics.