Skip to content

Add support for SigNoz backend #12

@nirga

Description

@nirga

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

  • SigNoz backend implementation complete
  • All abstract methods implemented
  • Query builder for SigNoz filter format
  • Configuration documented (self-hosted and cloud)
  • Tests passing for both deployment types
  • README updated with SigNoz examples
  • Works with Claude Desktop integration

Metadata

Metadata

Assignees

No one assigned

    Labels

    sourcesSupport for additional observability platforms

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions