Skip to content

Propagate W3C trace context from MCP _meta in telemetry #5758

Description

@JAORMX

Part of #5743 (Workstream C: 2026-07-28 stateless readiness).

Work

2026-07-28 standardizes OpenTelemetry propagation: W3C traceparent/tracestate/baggage ride in _meta (SEP-414). ToolHive's telemetry middleware (pkg/telemetry/middleware.go) currently records MCP attributes but doesn't join traces across client → proxy → server.

  • Extract trace context from _meta on inbound requests and set it as the span parent.
  • Inject/forward trace context toward backends (proxy passthrough should preserve it; vMCP as a protocol-terminating client should propagate it into backend calls).
  • Works with the RC schema today; harmless for 2025-11-25 peers that omit it.

Good first Workstream C item — independent of the stateless design work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for Task 📋.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions