-
Notifications
You must be signed in to change notification settings - Fork 488
feat(contrib/mcp-go): Initial mcp-go tracer implementation
#4100
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
base: main
Are you sure you want to change the base?
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
mcp-go tracer implementation
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🔗 Commit SHA: b00ba8a | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
| // Hooks provides Datadog tracing for MCP servers. | ||
| type Hooks struct { | ||
| // Stores data between start and end of tool calls. In-memory works because it must be on the same instance. | ||
| toolCache *ttlcache.Cache[any, *llmobs.ToolSpan] |
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.
The in-memory cache just stores data between the start and end hooks. Creating a middleware would have avoided this, but would have been harder to automatically add to all tools. We'll also use hooks for session initialization spans (another PR on this stack).
Unfortunately this cache implementation does need to be shut down manually.
I experimented with but decided against cache customization options (max size, ttl).
mcp-go tracer implementationmcp-go tracer implementation

What does this PR do?
Adds contrib library for
mcp-go. Uses it to record LLMObs Tool spans for tool calls.This is the base of a Graphite stack.
Motivation
Tech spec for this project
Closes MLOB-4372
Reviewer's Checklist
./scripts/lint.shlocally.Testing
In addition to automated tests, this was tested locally with Datadog MCP Server
Unsure? Have a question? Request a review!