-
Notifications
You must be signed in to change notification settings - Fork 490
feat(contrib/mcp-go): Trace MCP session initializations with MLObs spans #4101
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
This stack of pull requests is managed by Graphite. Learn more about stacking. |
BenchmarksBenchmark execution time: 2025-11-14 15:39:44 Comparing candidate commit 7f50759 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 24 metrics, 0 unstable metrics. |
498ae3a to
792093f
Compare
95af4d3 to
4def1e6
Compare
f2727e3 to
5f20214
Compare
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🔗 Commit SHA: 7f50759 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
f15f2c6 to
7af0a91
Compare
cd3a995 to
0a4f2bf
Compare
|
I made an update that removes the ttlcache. This was a relic of long term session tracking. I read the mcp-go code and did not see any code paths that would lead to the after or error hooks not being called, so records will always be deleted. This simplifies the design by removing the cleanup function. It would be hard to support via orchestrion with the cleanup. |
c177b06 to
38e2a00
Compare
0237e37 to
6bacb1a
Compare
|
@genesor Could you take a look please? |
|
@hannahkm Would love your review so I can get this in and hopefully soon integrated with dd-source. Thanks! |
…interface and directly annotating spans
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|

NB: This is part of a stack
What does this PR do?
In addition to tool calls, record task spans for session initialization.
Motivation
We want to record data like clientInfo during session Initialization and this seems like the best way to do it.
I considered a metric, but in the future we will also want to tag the session ID, and metrics do not do well with unique tags. Also, this allows viewing everything together in the LLMObs UI.
A writeup with more context on this design
Relates to MLOB-4373
Future
In future PRs I will add tags for session ID.
Reviewer's Checklist
./scripts/lint.shlocally.Unsure? Have a question? Request a review!