Description
Add support for Datadog as an observability backend, enabling users to query OpenTelemetry traces from Datadog APM.
Motivation
Datadog is one of the most popular observability platforms with extensive APM and tracing capabilities. Adding Datadog backend support would enable a large user base to leverage this MCP server for AI-powered trace analysis and debugging of their LLM applications.
Implementation Requirements
1. Backend Implementation
- Create
src/openllmetry_mcp/backends/datadog.py following the abstract interface in backends/base.py
- Implement the following methods:
search_traces() - Query traces using Datadog Trace API
get_trace() - Retrieve full trace details
list_services() - List available services
get_aggregated_usage() - Aggregate token usage metrics
2. Configuration
- Add
datadog as a backend type option
- Required configuration:
BACKEND_URL: Datadog site URL (e.g., https://api.datadoghq.com or https://api.datadoghq.eu)
BACKEND_API_KEY: Datadog API key
BACKEND_APP_KEY: Datadog Application key (required for trace queries)
- Update
.env.example with Datadog configuration example
3. API Integration
Reference Datadog APIs:
4. OpenLLMetry Support
Ensure proper parsing of OpenLLMetry semantic conventions (gen_ai.* attributes) from Datadog trace spans.
5. Documentation
- Add Datadog backend configuration to README.md
- Include Claude Desktop integration example
- Document both US and EU site configurations
- Add troubleshooting section for common Datadog connection issues
6. Testing
- Add unit tests in
tests/backends/test_datadog.py
- Test trace querying with Datadog's query syntax
- Test filtering, aggregation, and pagination
- Test error handling and authentication
Example Configuration
BACKEND_TYPE=datadog
BACKEND_URL=https://api.datadoghq.com
BACKEND_API_KEY=dd_api_key_here
BACKEND_APP_KEY=dd_app_key_here
References
Acceptance Criteria
Description
Add support for Datadog as an observability backend, enabling users to query OpenTelemetry traces from Datadog APM.
Motivation
Datadog is one of the most popular observability platforms with extensive APM and tracing capabilities. Adding Datadog backend support would enable a large user base to leverage this MCP server for AI-powered trace analysis and debugging of their LLM applications.
Implementation Requirements
1. Backend Implementation
src/openllmetry_mcp/backends/datadog.pyfollowing the abstract interface inbackends/base.pysearch_traces()- Query traces using Datadog Trace APIget_trace()- Retrieve full trace detailslist_services()- List available servicesget_aggregated_usage()- Aggregate token usage metrics2. Configuration
datadogas a backend type optionBACKEND_URL: Datadog site URL (e.g.,https://api.datadoghq.comorhttps://api.datadoghq.eu)BACKEND_API_KEY: Datadog API keyBACKEND_APP_KEY: Datadog Application key (required for trace queries).env.examplewith Datadog configuration example3. API Integration
Reference Datadog APIs:
DD-API-KEYandDD-APPLICATION-KEYheaders4. OpenLLMetry Support
Ensure proper parsing of OpenLLMetry semantic conventions (
gen_ai.*attributes) from Datadog trace spans.5. Documentation
6. Testing
tests/backends/test_datadog.pyExample Configuration
References
backends/jaeger.py,backends/tempo.py,backends/traceloop.pyAcceptance Criteria