Skip to main content
A destination is a place that receives incidents. A route chooses which incidents go to which destinations. This recipe adds a PagerDuty destination and a route that pages only for sev-1 incidents. Both steps need notifications:write. Reading deliveries needs notifications:read. You need a PagerDuty service with an Events API V2 integration. Put its integration key in an environment variable, so that it does not appear in your shell history or in a prompt:

Add the destination

The response hides the key. Keep the destination id:
To map severities another way, add severityMap to config, for example { "sev-1": "critical", "sev-2": "critical" }. See PagerDuty.

Add the route

The route matches sev-1 incidents. Its events list adds acknowledged, so that PagerDuty acknowledges the alert too. Without events, a route sends only opened and resolved.
The response has the route:
Other filters are in Add a route with filters. To change the destinations of a route later, use squasher notifications routes set-destinations.

Check the deliveries

A test through a PagerDuty destination sends a real trigger event and opens an alert in PagerDuty. Resolve that alert in PagerDuty afterward. Do not run a test on a service that pages a person at night.
Every delivery attempt is recorded with its status code. squasher notifications destinations test DESTINATION_ID sends a test event. Then read the recent deliveries:
Each delivery has this shape. A failed delivery has success: false and an errorMessage:
To remove the setup, delete the route and then the destination with squasher notifications routes delete ROUTE_ID --yes and squasher notifications destinations delete DESTINATION_ID --yes.

Next steps

PagerDuty

What Squasher sends and how severities map.

Notifications API

Every destination type and route field.