Skip to content

Proposal: Instrumentation Middleware #302

@kellysutton

Description

@kellysutton

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions