Integrations3 min read
Datadog
Receive Datadog monitor alerts in OpsKnight
Datadog Integration
Receive alerts from Datadog monitors and create incidents automatically.
Endpoint
POST /api/integrations/datadog?integrationId=YOUR_INTEGRATION_ID
Setup
Step 1: Create Integration in OpsKnight
- Go to Services and select your service
- Click Integrations tab
- Click Add Integration
- Select Datadog
- Copy the Integration ID
Step 2: Create Webhook in Datadog
- In Datadog, go to Integrations → Webhooks
- Click + New Webhook
- Configure:
| Field | Value |
|---|---|
| Name | OpsKnight |
| URL | https://YOUR_OPSKNIGHT_URL/api/integrations/datadog?integrationId=YOUR_INTEGRATION_ID |
| Payload | Use default (leave empty) |
| Custom Headers | Optional |
- Click Save
Step 3: Add Webhook to Monitors
- Open your Datadog Monitor
- In the Notify your team section, add:
@webhook-OpsKnight - Save the monitor
Payload Format
OpsKnight accepts the standard Datadog webhook payload:
{
"event_type": "alert",
"title": "[Triggered] CPU High on web-01",
"text": "CPU usage exceeded 90% threshold",
"alert_type": "error",
"date_happened": 1705312800,
"tags": ["env:production", "team:platform"],
"host": "web-01",
"aggregation_key": "datadog-alert-12345"
}
Monitor Format
Datadog can also send monitor-specific payloads:
{
"monitor": {
"id": 12345,
"name": "CPU Usage High",
"status": "triggered",
"message": "CPU usage exceeded threshold"
}
}
Alert Format
{
"alert": {
"id": "abc123",
"title": "Database Connection Error",
"message": "Connection pool exhausted",
"status": "triggered",
"severity": "error"
}
}
Event Mapping
| Datadog Status | OpsKnight Action |
|---|---|
triggered, alert |
Trigger incident |
resolved, ok |
Resolve incident |
success (alert_type) |
Resolve incident |
Severity Mapping
| Datadog Alert Type | OpsKnight Severity |
|---|---|
error |
critical |
warning |
warning |
info |
info |
success |
info |
Incident Title
The incident title is extracted in this order:
title(from event)alert.titlemonitor.name- Fallback: "Datadog Alert"
Deduplication
Dedup keys are generated in this order:
aggregation_key(if provided)datadog-alert-{alert.id}(if alert format)datadog-monitor-{monitor.id}(if monitor format)datadog-{timestamp}(fallback)
Best Practice
Use the aggregation_key in your Datadog webhook payload for consistent deduplication:
{
"aggregation_key": "cpu-high-{{host.name}}"
}
Security
Signature Verification (Optional)
You can secure the webhook with HMAC signature verification:
- In OpsKnight, set a Signing Secret on the integration
- Include header:
X-Signature: sha256=<hmac_signature>
Testing
Using Datadog UI
- Open a monitor in Datadog
- Click Test Notifications
- Select the OpsKnight webhook
- Verify incident appears in OpsKnight
Using cURL
Send a test payload directly:
curl -X POST "https://YOUR_OPSKNIGHT_URL/api/integrations/datadog?integrationId=YOUR_ID" \
-H "Content-Type: application/json" \
-d '{
"event_type": "alert",
"title": "Test Alert from Datadog",
"text": "This is a test alert",
"alert_type": "warning",
"date_happened": 1705312800,
"aggregation_key": "test-alert-001"
}'
Troubleshooting
Alerts Not Appearing
- Check webhook URL is correct in Datadog
- Verify integration ID is valid
- Check Datadog webhook logs for delivery status
- Ensure
@webhook-OpsKnightis added to monitor notifications
Incidents Not Resolving
- Verify monitor sends recovery notifications
- Check aggregation_key is consistent between trigger and resolve
Wrong Severity
- Set alert_type appropriately in webhook payload
- Use error/warning/info values
Related Topics
- Events API — Programmatic event submission
- Integrations Overview — All integrations
Last updated for v1
Edit this page on GitHub