# PagerDuty

> PagerDuty alert channels through the Events API v2 - one PagerDuty alert per incident, triggered on DOWN and resolved on recovery.

A PagerDuty channel opens and resolves PagerDuty alerts from Monitorly Cloud incidents.

1. In PagerDuty, open a service, add an integration of type **Events API V2** and copy its 32-character **Integration Key**.
2. On the project's **Alerts** page, choose **Add channel** → **PagerDuty** and paste the key.
3. **Send test**: PagerDuty gets an alert of severity `info`, resolved at once.

The key is 32 letters and digits. It is stored encrypted and never shown again. There is no URL to enter: messages go to `https://events.pagerduty.com/v2/enqueue`, which also takes keys of EU-region accounts.

## What PagerDuty gets

| Monitorly Cloud event                                                  | PagerDuty                          | Severity   |
| ---------------------------------------------------------------------- | ---------------------------------- | ---------- |
| A check is DOWN, a later escalation level, still down after maintenance | `trigger`                         | `critical` |
| The check recovered                                                    | `resolve` of the same alert        | —          |
| DOWN delivered after its incident already closed                       | `trigger`, then `resolve` at once  | `critical` |
| An offline private node                                                | `trigger`                          | `error`    |
| An SSL certificate or a domain expires soon                            | `trigger`                          | `warning`  |
| A test message                                                         | `trigger`, then `resolve` at once  | `info`     |

Each Monitorly Cloud incident is one PagerDuty alert: its `dedup_key` is the incident, so repeats of the escalation never open a second one. Alerts about an offline node or an expiring certificate or domain are not resolved by Monitorly Cloud; resolve them in PagerDuty. A later warning for the same certificate, domain or node joins the open alert. The alert's summary is the first line of the message, the whole text is in its custom details, the **Acknowledge** link is in its links, and the source is the check's name.

Acknowledging in PagerDuty stays in PagerDuty: it does not acknowledge the Monitorly Cloud incident. Use the **Acknowledge** link for that.

## When PagerDuty refuses

When PagerDuty says the routing key is not valid (the integration was deleted), answers 401, 403 or 404, or redirects, the channel is **Not delivering** at once. Add the new key as a new channel. When PagerDuty answers 429, delivery waits as long as it asks, or 30 seconds.

Everything else (retries, order) works as for the [other channels](https://docs.monitorly.cloud/alerts.md).
