<@U4H0M349G> I can see that the OpenTelemetryTraci...
# http4k
m
@dave I can see that the OpenTelemetryTracing filter does support parent based sampling but only if the "traceparent" is part of the "_meta" fields, so it does not honour the "traceparent" in the http request itself. I think that's ok, but would there be a way to propagate from the http header to the _meta using an McpFilter? and would that be acceptable?
This is the filter I am putting in place for the time being
d
yesh - you can set it using the filter, but it's technically not per-spec. https://opentelemetry.io/docs/specs/semconv/gen-ai/mcp/
interesting 1
Officially, the MCP call and the HTTP request are not related in a parent-child sense... there is a link between the 2 using the span links
m
Well it does say that "instrumentation" should propagate trace context into the params._meta bag, so I guess it's recommended.
d
that is meant to be populated by the client call, not on the server side.
I mean - it will work, and it's all very alpha - but that is the idea.
m
oh I see, that makes sense
d
of course - it entirely depends on who and what your client is as to if they populate it.
I'd probably build that filter in as a fallback in case they don't
👍 1
BTW - there will be a breaking change coming up in the next version of http4k. McpHandlers will be changing to take both JsonRpcRequests and JsonRpcResults (MCP is bidirectional) so we're introducing a new sealed JsonRpcMessage supertype. It will be a simple change to fix, but will be breaking 🙂
m
Ok, thanks for the heads up! 🙂
d
Ok, not the next version but the next next version - we've decided to release early because of a couple of CVE fixes to dependencies. 🙃