I'm proposing that we implement optional instrumentation middleware hooks for tool calls within the MCP Server.
Some context: We are accumulating a health list of tools available in platform, but we currently cannot create spans for the tool calls in our telemetry vendor (Datadog). We would like to be able to wrap the block of tool calls in...
Datadog::Tracing.trace(name, tags:) { }
I believe this should either live in lib/mcp/instrumentation.rb (instrumenting all handle_request calls) or more directly in lib/mcp/server.rb within the #call_tool method.
If this is interesting and aligned with the goals of this gem, we can take a pass at the initial PR here. Thanks!
cc @paholg
I'm proposing that we implement optional instrumentation middleware hooks for tool calls within the MCP Server.
Some context: We are accumulating a health list of tools available in platform, but we currently cannot create spans for the tool calls in our telemetry vendor (Datadog). We would like to be able to wrap the block of tool calls in...
I believe this should either live in
lib/mcp/instrumentation.rb(instrumenting allhandle_requestcalls) or more directly inlib/mcp/server.rbwithin the#call_toolmethod.If this is interesting and aligned with the goals of this gem, we can take a pass at the initial PR here. Thanks!
cc @paholg