Datadog
Overview¶
OpenSRE queries Datadog when you ask about an incident — logs, metrics, monitor state, and events correlated with it.
Prerequisites¶
- Datadog account with API access
- API key (organization settings)
- Application key with read scopes (
events_read,logs_read_data,logs_read_index_data,monitors_read)
Setup¶
Option 1: Interactive CLI¶
You will be prompted for API key, application key, and site (for example datadoghq.com or datadoghq.eu).
Option 2: Environment variables¶
Add to your .env:
DD_API_KEY=your-api-key
DD_APP_KEY=your-application-key
DD_SITE=datadoghq.com # optional — default datadoghq.com; use datadoghq.eu for EU
| Variable | Default | Description |
|---|---|---|
DD_API_KEY |
— | Required. Datadog API key |
DD_APP_KEY |
— | Required. Datadog application key |
DD_SITE |
datadoghq.com |
Datadog site hostname (EU: datadoghq.eu) |
For multiple Datadog orgs or sites, use multi-instance with DD_INSTANCES (not DATADOG_INSTANCES).
Option 3: Persistent store¶
{
"version": 1,
"integrations": [
{
"id": "datadog-prod",
"service": "datadog",
"status": "active",
"credentials": {
"api_key": "your-api-key",
"app_key": "your-application-key",
"site": "datadoghq.com"
}
}
]
}
Option 4: Hosted web app (OpenSRE Cloud)¶
Info
Hosted OpenSRE Cloud is coming soon. Until then, use the local CLI, environment variables, or persistent store above.
When available, organization-wide Datadog connectors will be configured in the hosted web app:
- In app.opensre.com, go to Integrations → Datadog
- Enter a name, and paste your API and application keys

Credentials¶
API key¶
- In Datadog, go to Organization Settings → API Keys (direct link)
- Click + New Key and name it (for example
opensre) - Copy the key

Application key¶
- Go to User Settings → Application Keys (direct link)
- Click + New Key and name it (for example
opensre) - Under Edit Scope, enable at minimum:
events_read,logs_read_data,logs_read_index_data,monitors_read - Under Actions API Access, click Enable
- Copy the key


Note
Some Datadog UI labels may still show an older product name. Any key name works — use opensre for clarity.
Tools¶
| Tool | Use it for |
|---|---|
query_datadog_logs |
Search logs with a concrete query (for example service:checkout status:error) |
query_datadog_metrics |
Infrastructure and application metrics |
query_datadog_monitors |
Monitor configuration and current states |
query_datadog_events |
Deployments, alerts, and system change events |
query_datadog_all |
Logs, monitors, and events in parallel for a fast first pass |
Verify¶
Expected output:
Example for the default US site with 12 monitors:
Inside the REPL: /integrations verify datadog or /verify datadog.
Troubleshooting¶
| Symptom | Fix |
|---|---|
| 403 Forbidden | Confirm application key scopes include logs_read_data and monitors_read |
| Wrong site / EU account | Set DD_SITE=datadoghq.eu (or your site hostname) |
| Verify passes but no logs returned | Check index retention and that the app key can read the target log index |
| Multiple Datadog accounts | Use DD_INSTANCES — see Multi-instance integrations |
Security¶
- Create a dedicated application key with read-only scopes.
- Store keys in
.envor your secret manager — not in source control.
Markdown source: View on AtomGit·Content from the open-source project op/opensre