Description
Add support for SigNoz as an observability backend, enabling users to query OpenTelemetry traces from SigNoz (self-hosted or cloud).
Motivation
SigNoz is mentioned specifically in the roadmap ("Support for additional backends (SigNoz, ClickHouse)"). SigNoz is a popular open-source alternative to Datadog/New Relic with native OpenTelemetry support, making it ideal for cost-conscious teams and self-hosted deployments.
Implementation Requirements
1. Backend Implementation
- Create
src/openllmetry_mcp/backends/signoz.py following the abstract interface in backends/base.py
- Implement the following methods:
search_traces() - Query traces using SigNoz Query Service API
get_trace() - Retrieve full trace details
list_services() - List available services
get_aggregated_usage() - Aggregate token usage metrics
2. Configuration
- Add
signoz as a backend type option
- Required configuration:
BACKEND_URL: SigNoz instance URL (e.g., http://localhost:3301 or https://your-signoz-cloud.signoz.io)
BACKEND_API_KEY: API key (for SigNoz Cloud) or empty for self-hosted
- Update
.env.example with SigNoz configuration example
3. API Integration
Reference SigNoz APIs:
4. Query Language
SigNoz uses a custom query builder for filtering traces. Example:
{
"start": 1609459200000,
"end": 1609545600000,
"filters": {
"items": [
{
"key": {"key": "serviceName", "type": "tag"},
"value": "api",
"op": "="
}
],
"op": "AND"
},
"limit": 100
}
5. OpenLLMetry Support
Ensure proper parsing of OpenLLMetry semantic conventions (gen_ai.* attributes) from SigNoz trace spans.
6. Documentation
- Add SigNoz backend configuration to README.md
- Include Claude Desktop integration example
- Document both self-hosted and SigNoz Cloud configurations
- Add troubleshooting section for common SigNoz connection issues
7. Testing
- Add unit tests in
tests/backends/test_signoz.py
- Test trace querying with SigNoz query format
- Test filtering, aggregation, and pagination
- Test error handling and authentication
- Test both self-hosted and cloud scenarios
Example Configuration
Self-hosted
BACKEND_TYPE=signoz
BACKEND_URL=http://localhost:3301
SigNoz Cloud
BACKEND_TYPE=signoz
BACKEND_URL=https://your-org.signoz.io
BACKEND_API_KEY=your_api_key_here
References
Acceptance Criteria
Description
Add support for SigNoz as an observability backend, enabling users to query OpenTelemetry traces from SigNoz (self-hosted or cloud).
Motivation
SigNoz is mentioned specifically in the roadmap ("Support for additional backends (SigNoz, ClickHouse)"). SigNoz is a popular open-source alternative to Datadog/New Relic with native OpenTelemetry support, making it ideal for cost-conscious teams and self-hosted deployments.
Implementation Requirements
1. Backend Implementation
src/openllmetry_mcp/backends/signoz.pyfollowing the abstract interface inbackends/base.pysearch_traces()- Query traces using SigNoz Query Service APIget_trace()- Retrieve full trace detailslist_services()- List available servicesget_aggregated_usage()- Aggregate token usage metrics2. Configuration
signozas a backend type optionBACKEND_URL: SigNoz instance URL (e.g.,http://localhost:3301orhttps://your-signoz-cloud.signoz.io)BACKEND_API_KEY: API key (for SigNoz Cloud) or empty for self-hosted.env.examplewith SigNoz configuration example3. API Integration
Reference SigNoz APIs:
Authorizationheader (Cloud) or no auth (self-hosted)4. Query Language
SigNoz uses a custom query builder for filtering traces. Example:
{ "start": 1609459200000, "end": 1609545600000, "filters": { "items": [ { "key": {"key": "serviceName", "type": "tag"}, "value": "api", "op": "=" } ], "op": "AND" }, "limit": 100 }5. OpenLLMetry Support
Ensure proper parsing of OpenLLMetry semantic conventions (
gen_ai.*attributes) from SigNoz trace spans.6. Documentation
7. Testing
tests/backends/test_signoz.pyExample Configuration
Self-hosted
SigNoz Cloud
References
backends/jaeger.py,backends/tempo.py,backends/traceloop.pyAcceptance Criteria