-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Adding Opentelemetry to MCP SDK #421
Copy link
Copy link
Open
Labels
P3Nice to haves, rare edge casesNice to haves, rare edge casesenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedready for workEnough information for someone to start working onEnough information for someone to start working onv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixesIdeas, requests and plans for v2 of the SDK which will incorporate major changes and fixes
Metadata
Metadata
Assignees
Labels
P3Nice to haves, rare edge casesNice to haves, rare edge casesenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedready for workEnough information for someone to start working onEnough information for someone to start working onv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixesIdeas, requests and plans for v2 of the SDK which will incorporate major changes and fixes
Is your feature request related to a problem? Please describe.
I would like to see Opentelemetry traces and Metrics baked into SDK.
E.g.
Describe the solution you'd like
I am trying to use Opentelemetry sdk to add traces and metrics features.
Steps
BaseSession(src/mcp/shared/session.py).traceparent) to_metaofRequestParams.Metabefore sending request from client (send_requestinsrc/mcp/shared/session.py)traceparentfrom received request to create new span with incoming span as parent span.Describe alternatives you've considered
I tried to implement the same via traceloop. I was not able to get correct parent - child relationship between spans while doing so.
Additional context
I am able to achieve distributed tracing across my Agentic application and MCP server.