Skip to content

Conversation

@ChrisJBurns
Copy link
Collaborator

Summary

  • Add SpanKindClient spans to the vMCP telemetry backend client with standard MCP OTEL attributes
  • Add mcp.client.operation.duration histogram using shared MCPOperationDurationBuckets from telemetry package
  • Fix server.port to be int per OTEL conventions (was string)
  • Fix error.type to use error message instead of Go type name (%T)
  • Inject W3C Trace Context (traceparent/tracestate) into outgoing MCP tool call requests via params._meta
  • Fix double %w in fmt.Errorf (changed to %v for second error)

Addresses #3399.

PR Stack (3/3): #3682 (propagation) → #3683 (metrics/attributes) → This PR

Test plan

  • go build ./... passes
  • go test ./pkg/vmcp/server/... passes
  • go test ./pkg/vmcp/client/... passes
  • task lint-fix passes with 0 issues
  • Verified resolveServerAddrPort returns (string, int) and attrServerPort.Int() is used

🤖 Generated with Claude Code

Add SpanKindClient spans to the vMCP telemetry backend client with
standard MCP OTEL attributes (mcp.method.name, server.address,
server.port as int, network.transport, gen_ai.tool.name).

Add mcp.client.operation.duration histogram using shared bucket
boundaries from the telemetry package. Fix error.type to use the
error message instead of Go type name. Fix server.port to be int
per OTEL conventions.

Inject W3C Trace Context (traceparent/tracestate) into outgoing
MCP tool call requests via params._meta for end-to-end distributed
tracing across vMCP → backend boundaries.

Addresses #3399.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 68.11594% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.02%. Comparing base (c69b4ad) to head (51df631).

Files with missing lines Patch % Lines
pkg/vmcp/server/telemetry.go 68.25% 15 Missing and 5 partials ⚠️
pkg/vmcp/client/client.go 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@                         Coverage Diff                          @@
##           otel/standard-metrics-attributes    #3684      +/-   ##
====================================================================
+ Coverage                             66.00%   66.02%   +0.01%     
====================================================================
  Files                                   418      418              
  Lines                                 41348    41401      +53     
====================================================================
+ Hits                                  27293    27333      +40     
- Misses                                11955    11960       +5     
- Partials                               2100     2108       +8     

☔ 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.

@ChrisJBurns ChrisJBurns changed the title Add CLIENT spans and trace context injection for vMCP backends DRAFT: Add CLIENT spans and trace context injection for vMCP backends Feb 9, 2026
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.

1 participant