-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededsourcesSupport for additional observability platformsSupport for additional observability platforms
Description
Description
Add support for Sentry as an observability backend, enabling users to query OpenTelemetry traces from Sentry Performance Monitoring.
Motivation
Sentry is widely adopted for error tracking and performance monitoring, with growing support for distributed tracing via OpenTelemetry. Adding Sentry backend support would enable users to leverage this MCP server for AI-powered analysis of traces alongside error data in Sentry.
Implementation Requirements
1. Backend Implementation
- Create
src/openllmetry_mcp/backends/sentry.pyfollowing the abstract interface inbackends/base.py - Implement the following methods:
search_traces()- Query traces using Sentry Discover/Traces APIget_trace()- Retrieve full trace detailslist_services()- List available services/projectsget_aggregated_usage()- Aggregate token usage metrics
2. Configuration
- Add
sentryas a backend type option - Required configuration:
BACKEND_URL: Sentry instance URL (e.g.,https://sentry.ioor self-hosted URL)BACKEND_API_KEY: Sentry auth token with trace read permissionsSENTRY_ORG: Organization slug (required)SENTRY_PROJECT: Project slug (optional, can query across org)
- Update
.env.examplewith Sentry configuration example
3. API Integration
Reference Sentry APIs:
- Discover API
- Traces API
- Organization Events
- Authentication: Bearer token in
Authorizationheader
4. OpenLLMetry Support
Ensure proper parsing of OpenLLMetry semantic conventions (gen_ai.* attributes) from Sentry trace spans and transaction data.
5. Documentation
- Add Sentry backend configuration to README.md
- Include Claude Desktop integration example
- Document both SaaS and self-hosted configurations
- Add troubleshooting section for common Sentry connection issues
- Note any limitations vs other backends (e.g., trace retention, query capabilities)
6. Testing
- Add unit tests in
tests/backends/test_sentry.py - Test trace querying with Sentry's discover query syntax
- Test filtering, aggregation, and error correlation
- Test error handling and authentication
Example Configuration
BACKEND_TYPE=sentry
BACKEND_URL=https://sentry.io
BACKEND_API_KEY=sntrys_abc123...
SENTRY_ORG=my-org
SENTRY_PROJECT=my-llm-appReferences
- Sentry Performance Monitoring
- Sentry OpenTelemetry Support
- Sentry Distributed Tracing
- Existing backend implementations:
backends/jaeger.py,backends/tempo.py,backends/traceloop.py
Additional Considerations
- Sentry's trace model may differ from pure OpenTelemetry backends (transactions vs spans)
- Consider integration with Sentry's error tracking for enhanced debugging
- May need to handle Sentry's sampling/retention policies differently
Acceptance Criteria
- Sentry backend implementation complete
- All abstract methods implemented
- Configuration documented (SaaS and self-hosted)
- Tests passing
- README updated with Sentry examples
- Works with Claude Desktop integration
- Document any backend-specific limitations
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededsourcesSupport for additional observability platformsSupport for additional observability platforms