Repository navigation
Add mcp.server.operation.duration metric per OTEL MCP semantic conventions - #3752
Merged
Merged
Conversation
ChrisJBurns
requested review from
JAORMX,
amirejaz,
blkt,
jerm-dro,
jhrozek and
yrobla
as code owners
February 10, 2026 19:10
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3752 +/- ##
==========================================
+ Coverage 66.36% 66.39% +0.02%
==========================================
Files 427 427
Lines 41894 41926 +32
==========================================
+ Hits 27803 27835 +32
+ Misses 11976 11974 -2
- Partials 2115 2117 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ChrisJBurns
force-pushed
the
otel/add-standard-metrics
branch
from
February 10, 2026 20:14
539e0a4 to
23f00b3
Compare
ChrisJBurns
force-pushed
the
otel/add-standard-metrics
branch
from
February 10, 2026 20:22
23f00b3 to
d187fa8
Compare
jerm-dro
reviewed
Feb 10, 2026
…tions Implement the mcp.server.operation.duration histogram metric as defined by the OTEL MCP semantic conventions. This records operation latency with spec-defined attributes (mcp.method.name, gen_ai.tool.name, gen_ai.operation.name, gen_ai.prompt.name, jsonrpc.protocol.version, network.transport, network.protocol.name, network.protocol.version, error.type) alongside existing custom toolhive_mcp_* metrics. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ChrisJBurns
force-pushed
the
otel/add-standard-metrics
branch
from
February 10, 2026 21:51
d187fa8 to
42eafe8
Compare
mcp.server.operation.duration metric per OTEL MCP semantic conventions
jerm-dro
approved these changes
Feb 10, 2026
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mcp.server.operation.durationhistogram metric as defined by the OTEL MCP semantic conventionsmcp.method.name,gen_ai.tool.name,gen_ai.operation.name,gen_ai.prompt.name,jsonrpc.protocol.version,network.transport,network.protocol.name,network.protocol.version,error.typeMCPHistogramBucketsfor reuse by future metrics (e.g.mcp.server.session.duration)toolhive_mcp_*metrics are preserved for backward compatibilityNote:
mcp.server.session.durationis intentionally deferred — it will be trivial to add after the session management architecture refactor (#38).Test plan
TestHTTPMiddleware_OperationDuration/tools/call— verifies metric recorded with tool attributesTestHTTPMiddleware_OperationDuration/prompts/get— verifies metric recorded with prompt attributesTestHTTPMiddleware_OperationDuration/non-MCP— verifies metric is NOT recorded for non-MCP requeststask lint-fixpasses with 0 issuestask testpasses🤖 Generated with Claude Code