# PageDuty

## Incidents API

Set up a **PagerDuty** connection for Streaming Data Platform alerts and notifications.

Keep in mind\
This option is deprecated in Lenses version 4.1. Editing existing connections and channels for PagerDuty incident integration will still be available, but there is no option for creating new connections and channels for this kind of integration.

Instead of using the Incidents API, please use the PagerDuty Events API

### Set up  <a href="#set-up" id="set-up"></a>

**1.** Visit **Admin → Connections** and click **New connection**

<figure><img src="https://docs.lenses.io/5.2/guides/self-service/alerts/alert-channels/images/new_connection.png" alt="Lenses.io Connection" width="563"><figcaption></figcaption></figure>

**2.** Select **PagerDuty**

<figure><img src="https://docs.lenses.io/5.2/guides/self-service/alerts/alert-channels/images/select_connection_pagerduty.png" alt="PagerDuty Connection" width="563"><figcaption></figcaption></figure>

**3.** Provide a name and configuration

You can also optionally add tags (i.e., dev). Then add the PagerDuty API Key, which must be a General Access REST API Key. To obtain the API Token, log in to PagerDuty and navigate to `API Access Keys` page under `Configuration` menu, then create a new API Key.

<figure><img src="https://docs.lenses.io/5.2/guides/self-service/alerts/alert-channels/images/create_connection_pagerduty.png" alt="PagerDuty Connection" width="563"><figcaption></figcaption></figure>

### Add channel  <a href="#add-channel" id="add-channel"></a>

Next, add one or multiple target PagerDuty channels.

**1.** Visit **Admin → Channels** and click **PagerDuty**

<figure><img src="https://docs.lenses.io/5.2/guides/self-service/alerts/alert-channels/images/select_channel_pagerduty.png" alt="PagerDuty channel" width="563"><figcaption></figcaption></figure>

**2.** Setup the configuration options

<figure><img src="https://docs.lenses.io/5.2/guides/self-service/alerts/alert-channels/images/pagerduty_details.png" alt="PagerDuty details"><figcaption></figcaption></figure>

First, go to the PagerDuty `Services` page and create a new service. When choosing `Integration Type`, pick `Don't use an integration`. Once saved, the service identifier can be grabbed from the browser URL on the service details page.

```bash
http://****.pagerduty.com/service-directory/PZXAEXE
```

For the above example, the service id is **PZXAEXE**

Use the above within Lenses to create a `pager-duty-channel`, that uses the **pager-duty** connection to send information to the `PZXAEXE` service id from the email address of your admin.

### An example  <a href="#an-example" id="an-example"></a>

If, for example, you create a rule to send infrastructure notifications to PagerDuty, a specific alert will be sent to the specific PagerDuty connection when a Broker becomes offline.

<br>

## Events API

Set up a **PagerDuty** connection for Streaming Data Platform alerts and notifications using the PagerDuty Events API.

### Set up  <a href="#set-up" id="set-up"></a>

**1.** Visit **Admin → Connections** and click **New connection**

<figure><img src="https://docs.lenses.io/5.2/guides/self-service/alerts/alert-channels/images/new_connection.png" alt="Lenses.io Connection" width="563"><figcaption></figcaption></figure>

**2.** Select **PagerDuty**

<figure><img src="https://docs.lenses.io/5.2/guides/self-service/alerts/alert-channels/images/select_connection_pagerduty.png" alt="PagerDuty Connection" width="563"><figcaption></figcaption></figure>

**3.** Provide a name and configuration

You can also optionally add tags (i.e., dev). Then add the PagerDuty Integration Key. To obtain the Integration Key, go to the PagerDuty `Services` page and create a new service. When choosing `Integration Type`, pick `Use our API directly` with `Events API v2`. Once saved, the service goes to `Services`, chooses created service, and goes to `Integrations` the tab.

<figure><img src="https://docs.lenses.io/5.2/guides/self-service/alerts/alert-channels/images/create_connection_pagerduty_v2.png" alt="PagerDuty Connection" width="563"><figcaption></figcaption></figure>

### Add channel  <a href="#add-channel" id="add-channel"></a>

Next, add one or multiple target PagerDuty channels.

**1.** Visit **Admin → Channels** and click **PagerDuty**

<figure><img src="https://docs.lenses.io/5.2/guides/self-service/alerts/alert-channels/images/select_channel_pagerduty.png" alt="PagerDuty channel" width="563"><figcaption></figcaption></figure>

**2.** Setup the configuration options

<figure><img src="https://docs.lenses.io/5.2/guides/self-service/alerts/alert-channels/images/pagerduty_details_v2.png" alt="PagerDuty details" width="563"><figcaption></figcaption></figure>

### An example  <a href="#an-example" id="an-example"></a>

If, for example, you create a rule to send infrastructure notifications to PagerDuty, a specific alert will be sent to the specific PagerDuty connection when a Broker becomes offline.
