Skip to content

Align vMCP client telemetry with OTEL MCP semantic conventions - #3775

Merged
ChrisJBurns merged 1 commit into
mainfrom
otel/vmcp-client-spec-compliance
Feb 11, 2026
Merged

ChrisJBurns merged 1 commit into
mainfrom
otel/vmcp-client-spec-compliance

Conversation

@ChrisJBurns

@ChrisJBurns ChrisJBurns commented Feb 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Aligns vMCP backend client spans and metrics with the OTEL MCP semantic conventions
  • Span names changed from internal format (telemetryBackendClient.call_tool) to spec format (tools/call my-tool)
  • Adds mcp.method.name (Required) to all client spans
  • Adds spec-required attributes to mcp.client.operation.duration metric: mcp.method.name, network.transport, and error.type on error
  • Adds gen_ai.tool.name, gen_ai.prompt.name, mcp.resource.uri to appropriate method spans
  • Keeps all existing ToolHive-specific attributes for backward compatibility
  • Avoids unbounded cardinality in ReadResource span names by omitting the URI from the span name (captured in attributes instead)
  • Adds resource_uri backward-compat attribute to ReadResource, matching the pattern used by CallTool (tool_name) and GetPrompt (prompt_name)
  • Adds unit tests for mapActionToMCPMethod and mapTransportTypeToNetworkTransport mapping functions

Parent issue: #3399

Test plan

  • go build ./pkg/vmcp/server/... compiles cleanly
  • go test ./pkg/vmcp/server/... passes (including new unit tests)
  • task lint-fix passes with 0 issues

🤖 Generated with Claude Code

@github-actions github-actions Bot added the size/XS Extra small PR: < 100 lines changed label Feb 11, 2026
@codecov

codecov Bot commented Feb 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.51852% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.58%. Comparing base (60f23f5) to head (3f60f5f).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pkg/vmcp/server/telemetry.go 68.51% 16 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3775      +/-   ##
==========================================
+ Coverage   66.57%   66.58%   +0.01%     
==========================================
  Files         432      432              
  Lines       42215    42259      +44     
==========================================
+ Hits        28103    28139      +36     
- Misses      11970    11979       +9     
+ Partials     2142     2141       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/XS Extra small PR: < 100 lines changed size/S Small PR: 100-299 lines changed labels Feb 11, 2026
@ChrisJBurns
ChrisJBurns force-pushed the otel/vmcp-client-spec-compliance branch from 1df65cb to 22ad587 Compare February 11, 2026 14:45
@github-actions github-actions Bot removed the size/S Small PR: 100-299 lines changed label Feb 11, 2026
@ChrisJBurns
ChrisJBurns force-pushed the otel/vmcp-client-spec-compliance branch from 22ad587 to 013b7b8 Compare February 11, 2026 14:45
@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Feb 11, 2026
jerm-dro
jerm-dro previously approved these changes Feb 11, 2026
Comment thread pkg/vmcp/server/telemetry.go Resolved
Comment thread pkg/vmcp/server/telemetry.go Resolved
- Change span names from internal format (telemetryBackendClient.call_tool)
  to spec format (tools/call my-tool)
- Add mcp.method.name (Required) to all client spans
- Add spec-required attributes to mcp.client.operation.duration metric:
  mcp.method.name, network.transport, and error.type on error
- Add gen_ai.tool.name, gen_ai.prompt.name, mcp.resource.uri to
  appropriate method spans
- Add resource_uri backward-compat attribute to ReadResource
- Avoid unbounded cardinality in ReadResource span names by omitting
  the URI from the span name (captured in attributes instead)
- Keep all existing ToolHive-specific attributes for backward compatibility
- Add unit tests for mapActionToMCPMethod and
  mapTransportTypeToNetworkTransport mapping functions

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@ChrisJBurns
ChrisJBurns force-pushed the otel/vmcp-client-spec-compliance branch from 013b7b8 to 3f60f5f Compare February 11, 2026 15:37
@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Feb 11, 2026
@ChrisJBurns
ChrisJBurns merged commit 15eaa3c into main Feb 11, 2026
36 checks passed
@ChrisJBurns
ChrisJBurns deleted the otel/vmcp-client-spec-compliance branch February 11, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Small PR: 100-299 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants