Skip to content

Deprecate redundant custom duration metrics in favor of OTEL MCP standard metrics #3791

Open

Description

@ChrisJBurns

Summary

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

  1. Current release: Both custom and standard metrics emitted (status quo)
  2. 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
  3. 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
  • toolhive_vmcp_backends_discovered (Gauge) — ToolHive-specific operational metric
  • toolhive_vmcp_workflow_* (3 metrics) — composite workflows are a ToolHive concept

Related

Activity

  1. added
    enhancement
    go
    on Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgotelemetry

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions