# PagerDuty

Firefly integrates with PagerDuty to provide real-time notifications for critical infrastructure events, policy violations, and other important alerts. This integration enables teams to receive immediate notifications and manage incidents effectively through PagerDuty's incident management platform.

When integrating with PagerDuty, you have two primary methods:

* [Integration Key](#integration-key).
* [General Access REST API Key](#general-access-rest-api-key).

## Prerequisites

* A PagerDuty account with administrative access.
* Appropriate permissions to generate integration keys or API keys.
* A configured PagerDuty service for receiving notifications.

## Setup Procedure

### Integration Key (Recommended Method)

Use this method for optimal integration with a specific PagerDuty service.

1. Generate an Integration Key:
   * Visit the [PagerDuty documentation](https://support.pagerduty.com/docs/services-and-integrations#generate-a-new-integration-key).
   * Follow the instructions to generate a new integration key.
   * Copy the Integration Key.
2. In Firefly:
   * Click **Settings > Integrations**.
   * Click **Add New > PagerDuty**.
   * Enter a descriptive name in the **Nickname** field.
   * Select **Integration Key** from the Integration Type field.
   * Paste the Integration Key in the **Key** box.
   * Click **Next**.
   * Click **Done**.

### General Access REST API Key

Use this method to generate notifications for all services available in your PagerDuty account.

> **Note**: For optimal integration, we recommend using an Integration Key instead.

1. Generate a Read-Only REST API Key:
   * Visit the [PagerDuty documentation](https://support.pagerduty.com/docs/api-access-keys#generate-a-general-access-rest-api-key).
   * Follow the instructions to generate a general access REST API key.
   * Copy the API key.
2. In Firefly:
   * Click **Settings > Integrations**.
   * Click **Add New > PagerDuty**.
   * Enter a descriptive name in the **Nickname** field.
   * Select **General Access REST API Key** from the Integration Type field.
   * Paste the API key in the **Key** field.
   * Click **Next**.
   * Click **Done**.

## Features Enabled

* **Real-time Incident Creation**: Automatically create PagerDuty incidents for critical events.
* **Service-specific Routing**: Direct notifications to specific PagerDuty services.
* **Rich Incident Details**: Include comprehensive information in incident descriptions.
* **Automated Resolution**: Close incidents when issues are resolved in Firefly.
* **Priority Management**: Set appropriate incident priorities based on event severity.

> **Note:** In the integration settings page, use the notifcation test button to test the integration.
