amonit

← Docs

Connect Datadog to Amonit

Amonit team · Updated

Short answer: add a webhook in Datadog’s Webhooks integration with your Amonit URL and the payload below. Then mention @webhook-amonit in each monitor that should page. A triggered monitor opens an alert in Amonit, and its recovery resolves the alert.

Set it up

  1. In Amonit, go to Integrations → Datadog → Connect, pick the team that should be paged, and save. The integration’s page shows its URL.
  2. In Datadog, go to Integrations → Webhooks and add a webhook. Name it amonit, and use the URL from Amonit.
  3. Replace the payload with this one, and leave Encode as form off:
{
  "alert_id": "$ALERT_ID",
  "transition": "$ALERT_TRANSITION",
  "priority": "$ALERT_PRIORITY",
  "title": "$EVENT_TITLE",
  "status": "$ALERT_STATUS",
  "scope": "$ALERT_SCOPE",
  "hostname": "$HOSTNAME",
  "message": "$TEXT_ONLY_MSG",
  "link": "$LINK",
  "org": "$ORG_NAME"
}
  1. In the message of each monitor that should page, add @webhook-amonit. Put it outside any {{#is_alert}} block, so that Datadog also sends the recovery.

You need the template. Datadog’s default payload says neither which monitor fired nor whether it triggered or recovered, so Amonit refuses it with 422. The variables come from Datadog’s Webhooks integration.

What happens

Datadog sends ($ALERT_TRANSITION) Amonit
Triggered, Re-Triggered, Renotify Opens an alert with the monitor’s priority, P1–P5. A monitor without a priority opens P3. If the alert is already open, this counts as a repeat and doesn’t page again.
Warn, Re-Warn, No Data, Re-No Data Opens a P3 alert, or P4 or P5 if the monitor has that priority.
Recovered Resolves the alert.
Anything else Ignored.
  • One alert per monitor and group. A multi alert monitor, such as one split by {host}, opens a separate alert for each group that alerts. Each group’s recovery resolves only its own alert.
  • The alert’s title is the monitor’s title, without Datadog’s [P1] [Triggered on …] prefix. The alert links back to the event in Datadog.
  • The alert goes to the integration’s team, and that team’s escalation policy decides who gets the push and the phone call.

Security

The URL contains the integration’s token, and anyone who has it can open alerts for that team. If it leaks, regenerate it on the integration’s page: the old URL stops working at once.

Limits

This setup follows Datadog’s documentation. We haven’t yet run it against a live Datadog account. If something doesn’t behave as described here, email [email protected].