You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deprecate redundant custom duration metrics in favor of OTEL MCP standard metrics #3791
ToolHive now emits OTEL MCP semantic convention duration metrics alongside the original custom metrics. Two custom histogram metrics are redundant and should be deprecated and eventually removed.
Redundant Metrics
Custom Metric (redundant)
Standard Replacement
Location
toolhive_mcp_request_duration
mcp.server.operation.duration
pkg/telemetry/middleware.go
toolhive_vmcp_backend_requests_duration
mcp.client.operation.duration
pkg/vmcp/server/telemetry.go
Both pairs measure the same duration in seconds using the same histogram bucket boundaries ([0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300]). The standard metrics use richer OTEL MCP semconv attributes (mcp.method.name, network.transport, error.type, gen_ai.tool.name, etc.).
Proposed Deprecation Plan
Current release: Both custom and standard metrics emitted (status quo)
Next minor release: Log a deprecation warning at startup when the custom metrics are being consumed (if detectable), and document the deprecation in release notes
Following minor release: Remove the custom metrics entirely
Non-Redundant Metrics (No Action Needed)
These custom metrics have no direct OTEL MCP standard equivalent and should be retained:
toolhive_mcp_requests (Counter) — no standard counter exists
toolhive_mcp_tool_calls (Counter) — scoped convenience counter for tools/call
toolhive_mcp_active_connections (UpDownCounter) — no standard gauge equivalent
toolhive_vmcp_backend_requests (Counter) — no standard counter exists
toolhive_vmcp_backend_errors (Counter) — no standard error counter
Activity