Datadog Integration
The Datadog integration lets Datadog push monitor alerts to OpsiMate with a Datadog Webhook.
OpsiMate does not poll Datadog for alerts, and Datadog alert ingestion does not require a Datadog API key.
Webhook URL​
Configure your Datadog webhook to send alerts to your OpsiMate server:
http://<your-opsimate-host>:3001/api/v1/alerts/custom/datadog?api_token={your_api_token}
Replace {your_api_token} with the API token configured in your OpsiMate server.
Instead of the api_token query parameter, you can send the token in an X-API-Token header. In the Datadog webhook, add it under Custom headers:
{
"X-API-Token": "{your_api_token}"
}
API Token Configuration​
The API token used in the webhook URL is managed by OpsiMate through an environment variable:
- Env var:
API_TOKEN - Default value:
opsimate
If you are using the simple deployment (via the provided docker-compose.yml), the API_TOKEN environment variable is already defined there for you.
Make sure your OpsiMate server is started with API_TOKEN set (or rely on the default), and use the same value in the Datadog webhook.
Setting Up the Webhook in Datadog​
-
In Datadog, go to Integrations > Webhooks.
-
Click New to create a new webhook.
-
Give the webhook a name, for example
opsimate-alerts. -
Paste the webhook URL above into the URL field.
-
Set the Payload to this custom payload:
{"alert_id": "$ALERT_ID","id": "$ALERT_CYCLE_KEY","title": "$EVENT_TITLE","message": "$EVENT_MSG","alert_status": "$ALERT_STATUS","alert_transition": "$ALERT_TRANSITION","event_type": "$EVENT_TYPE","link": "$LINK","tags": "$TAGS","alert_scope": "$ALERT_SCOPE","date": "$DATE","last_updated": "$LAST_UPDATED","org": {"id": "$ORG_ID","name": "$ORG_NAME"}} -
If you want priority-based severity (see Severity), also add
"priority": "$ALERT_PRIORITY"to the payload. Use$ALERT_PRIORITY(the monitor priority, P1–P5), not$PRIORITY, which is the event priority (normal/low). -
Save the webhook.
Attaching the Webhook to Monitors​
- Open the Datadog monitor you want in OpsiMate.
- In the monitor's Notify section, add
@webhook-opsimate-alerts(or@webhook-followed by the name you chose). - Save the monitor and trigger a test notification to check that the alert shows up in OpsiMate.
How the Payload Is Read​
id,titleanddateare required. A body without them is rejected with HTTP 400.ididentifies the alert. A later notification with the sameidupdates that alert.$ALERT_CYCLE_KEYstays the same from the time an alert triggers until it resolves, so the recovery notification matches the original alert. Don't use$IDhere: it is a new event ID on every notification, so recoveries would never resolve the alert.titlebecomes the alert name andmessagebecomes the summary.linkbecomes a View in Datadog link on the alert.
Auto-Resolve​
When alert_transition contains Recovered, OpsiMate resolves the alert with the same id.
Tags​
Every key:value entry in $TAGS becomes an alert tag. Entries without exactly one : are skipped.
Severity​
- A
severity:critical(orseverity:warning/severity:info) tag on the monitor wins. - Otherwise the monitor's priority (
$ALERT_PRIORITY) is used: P1 → critical, P2–P3 → warning, P4–P5 → info. - Unknown or missing values → warning.
The Configure Form​
The Datadog card on the Integrations page still has a form with the Datadog URL, API key and Application key. Alert ingestion does not need these: the webhook above is all OpsiMate needs to receive Datadog alerts.
Important Disclaimer​
Datadog sends webhooks only to HTTP endpoints it can reach.
- Datadog runs in the cloud, so it cannot call
localhoston your OpsiMate server directly. - Deploy OpsiMate behind a reachable URL, reverse proxy, or secure tunnel so Datadog can reach the webhook endpoint.
Official Resources​
- Datadog Website: https://www.datadoghq.com/
- Documentation: https://docs.datadoghq.com/
- API Documentation: https://docs.datadoghq.com/api/
- Getting Started: https://docs.datadoghq.com/getting_started/
- Webhooks integration: https://docs.datadoghq.com/integrations/webhooks/