feat(mcp): add Sentry tracing for MCP tool calls #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces comprehensive MCP (Model Context Protocol) tracing with Sentry for the GitHub Actions Utils CLI, following OpenTelemetry MCP Semantic Conventions. It implements a type-safe wrapper for MCP tool calls, captures detailed attributes and errors, and documents both the implementation and the design rationale. The changes also include extensive testing and updates to user and developer documentation.
MCP Tracing Implementation:
WithSentryTracing) for MCP tool handlers ininternal/cli/mcp/sentry.go, enabling automatic span creation, argument extraction, result tracking, and error capture for tool calls.internal/cli/mcp/server.go, simplifying the process of adding new tools with observability.Documentation and Analysis:
docs/IMPLEMENTATION_SUMMARY.mdsummarizing the implementation, usage, attributes, architecture decisions, and future enhancements for MCP tracing.docs/ANALYSIS_SENTRY_MCP_INTEGRATION.mdproviding a deep analysis of the Sentry JavaScript MCP integration, comparing its architecture and features to the new Go implementation.AGENTS.mdwith a new MCP Tracing section, describing key features, integration instructions, and referencing the full documentation.These changes collectively deliver robust, production-ready observability for MCP tool calls, with clear documentation and an easy-to-use API for future tool development.
Collected data can be seen here:
https://techprimate.sentry.io/insights/ai/mcp/?project=4510306572828672&statsPeriod=1h