Repository navigation
Add mcp.protocol.version, client operation duration, span target naming, and client span kind - #3757
Merged
Merged
Conversation
- Fix SSE active connections gauge that was incremented but never decremented. Move increment into Handler with a defer decrement so the gauge correctly tracks SSE connection lifecycle. - Fix config file `use-legacy-attributes: false` being silently ignored. Change UseLegacyAttributes from bool to *bool in app config so nil (not set) is distinguishable from explicit false. Add two test cases covering both scenarios. - Log metric creation errors at debug level instead of silently discarding them. The OTEL SDK returns no-op instruments on error so there is no runtime risk, but logging aids troubleshooting. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…ng, and client span kind
- Add mcp.protocol.version span attribute by reading the
MCP-Protocol-Version header from streamable HTTP requests.
- Add mcp.client.operation.duration histogram metric to vMCP backend
client using the OTEL MCP semconv bucket boundaries, alongside the
existing toolhive_vmcp_backend_requests_duration custom metric.
- Include target name in span names per OTEL MCP semconv. Span names
now follow the "{method} {target}" format, e.g. "tools/call
github_search" instead of just "tools/call".
- Set SpanKindClient on vMCP backend call spans for proper distributed
trace linking.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
ChrisJBurns
requested review from
JAORMX,
amirejaz,
jerm-dro,
jhrozek and
yrobla
as code owners
February 10, 2026 23:09
mcp.protocol.version, client operation duration, span target naming, and client span kind
rdimitrov
previously approved these changes
Feb 10, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3757 +/- ##
==========================================
- Coverage 66.50% 66.42% -0.09%
==========================================
Files 428 428
Lines 42069 42084 +15
==========================================
- Hits 27979 27955 -24
- Misses 11956 12001 +45
+ Partials 2134 2128 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rdimitrov
approved these changes
Feb 10, 2026
JAORMX
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
Four small OTEL MCP semantic conventions compliance fixes, building on #3756:
mcp.protocol.versionattribute: Read theMCP-Protocol-Versionheader from streamable HTTP requests and emit as a span attribute per the OTEL MCP semconv.mcp.client.operation.durationmetric: Add the spec-defined histogram metric to the vMCP backend client with correct bucket boundaries (MCPHistogramBuckets), alongside the existingtoolhive_vmcp_backend_requests_durationcustom metric.Span naming with target: Span names now follow the OTEL MCP semconv
"{method} {target}"format (e.g.,"tools/call github_search"instead of"tools/call").SpanKindClienton backend calls: vMCP backend call spans now usetrace.SpanKindClientinstead of the default Internal kind, enabling proper distributed trace linking.Depends on #3756.
Test plan
"{method} {target}"format🤖 Generated with Claude Code