-
Notifications
You must be signed in to change notification settings - Fork 449
feat(llmobs): distributed tracing for mcp #14045
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to add ddtrace/contrib/internal/mcp and tests/contrib/mcp to CODEOWNERS for llmobs?
Bootstrap import analysisComparison of import times between this PR and base. SummaryThe average import time from this PR is: 279 ± 4 ms. The average import time from base is: 281 ± 2 ms. The import time difference between this PR and base is: -1.9 ± 0.1 ms. Import time breakdownThe following import paths have shrunk:
|
Performance SLOsCandidate: evan.li/distributed-mcp (411a83f) 🔵 No Baseline Data (24 suites)🔵 coreapiscenario - 12/12 (2 unstable)🔵 No baseline data available for this suite
|
releasenotes/notes/trace-mcp-distributed-tracing-998f8cb35062a77e.yaml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comments but functionality looks good so far! Might be nice to include an example script and resulting trace in the PR description to show that this works in-app 😄
@ncybul updated the description w an example! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding an example! LGTM
e6c16af
to
95642ef
Compare
This PR implements distributed tracing between client/server tool calls for APM and LLM Obs by
send_request
_meta
field in the requestToolManager.call_tool
Distributed tracing is toggled via
DD_MCP_DISTRIBUTED_TRACING=True/False
, and defaults toTrue
This is also how openinference/otel do it
lastmile-ai/mcp-agent#239
modelcontextprotocol/modelcontextprotocol#246 (comment)
For reference, here is the meta field in the mcp sdk
APM distributed tracing is not included in this pr
Example script
Resulting trace:

Checklist
Reviewer Checklist