Skip to main content

Sending Alerts to Pagerduty

Many operations teams prefer to use an incident response service like PagerDuty to track production issues. Alert webhooks can be configured to generate PagerDuty incidents by invoking PagerDuty's API.

To send alerts to PagerDuty, point an alert webhook at https://events.pagerduty.com/v2/enqueue and then configure a payload template that contains PagerDuty API's required fields:

{
"routing_key": "YOUR-PAGERDUTY-KEY",
"event_action": "trigger",
"links": [{ "href": "$URL", "text": "Link to Prismatic alert monitor" }],
"payload": {
"summary": "$NAME triggered - $INSTANCE failed to run.",
"severity": "error",
"source": "$SUBJECT"
}
}

Additional fields listed in PagerDuty's docs can be added to the payload template to add additional information to the PagerDuty incident. No special headers are required for this alert webhook since the PagerDuty key is passed in as part of the payload. When an alert monitor using this alert webhook fires, an incident is created in PagerDuty:

Sample alert details in PagerDuty app