# PagerDuty

## Overview

PagerDuty does an excellent job in aggregating data from myriad monitoring tools and creating actionable insights in the form of incidents. Using PagerDuty with Fylamynt for incident response in a completely automated fashion is the match we all need today. To access this, users can tap into the real-time PagerDuty intel with the workflow automation features of Fylamynt to improve full-stack visibility and accelerated incident response.

## Use Cases

The integration between Fylamynt and PagerDuty lets you:

* Ingest incidents from PagerDuty are collected from various monitoring tools and grouped into actionable insights.
* Leverage automated workflows in Fylamynt and create incident response best practices to reduce MTTR.
* Access hundreds of Fylamynt’s third-party integration actions to coordinate response across multiple cloud infrastructure functions such as AWS, GCP, and Azure.

To find out more about this integration, please refer to the following [blog](https://www.fylamynt.com/post/fylamynt-pagerduty-automated-incident-response) and [video](https://www.youtube.com/watch?v=XqGewhz3vYU).

## Configure PagerDuty in Fylamynt

* Navigate to **Settings** > **Integrations** > **PagerDuty**.
* Configure a new integration instance.

Details needed to set up **PagerDuty instance** in **Fylamynt**:

<table data-header-hidden><thead><tr><th>Parameter</th><th width="394">Description</th><th>Required</th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td>Description</td><td><strong>Required</strong></td></tr><tr><td>PagerDuty API Token</td><td>API Token obtained from PagerDuty</td><td>True</td></tr><tr><td>Webhook API Key Name</td><td>Fylamynt API Key name</td><td>True</td></tr><tr><td>PagerDuty Webhook URL</td><td>Fylamynt Webhook URL to be used by PagerDuty service</td><td>True</td></tr></tbody></table>

Webhook is used to **fetch alerts** from PagerDuty in real-time. You can also **Enable / Disable** PagerDuty Webhook.

Follow the steps listed below in your **PagerDuty Account** and get the desired parameters to enter in **Fylamynt**.

* In your **PagerDuty Account**, go to **"DEVELOPER TOOLS"** --> **"API Access"**.
* Create a new API Key and copy the **"API Key"** generated to the **"PagerDuty API Token"** field in Fylamynt.
* Now configure PagerDuty - Fylamynt workflow trigger (webhook) with the below steps
  * Go to **PagerDuty Services** --> **Service Directory**
  * Select any existing PagerDuty Service and go to IntegrationsIn Extensions and Add-Ons of Integrations, click on Add or manager extensions and Select **"Generic V2 Webhook"** type.
  * Add below details to **New Extension** --> **Generic V2 Webhook**
    * URL:
      * copy URL from the **"PagerDuty Webhook URL"** in the right panel
    * Custom Headers:
      * **Header Name**: **x-api-key**
      * **Header Value**: add **"Webhook API Key value"** from the right-side panel
    * Instructions to get Fylamynt " Webhook API Key value":
      * Under Authorize Fylamynt, choose one of the **Webhook API Key Name** from the dropdown, and the corresponding **Webhook API Key Value** should be shown. If no options are available for the **Webhook API Key Name**, first go to **Settings** --> **API Keys** --> **Manage Keys** to Create a New API Key.

## Integration Actions

You can add these actions in the Fylamynt workflow builder, as part of your workflow.

1. [PagerDuty Alert Trigger](#pagerduty-alert-trigger)
2. [PagerDuty Create Incident](#pagerduty-create-incident)
3. [PagerDuty Resolve Incident](#pagerduty-resolve-incident)

### Pagerduty Alert Trigger

The integration node triggers the automatic execution of a workflow from a selected **PagerDuty Service**.

When creating a workflow, you are presented with a wizard to select the trigger type to use.

* On the workflow page, select **New Workflow**
* Enter the name of the Workflow.
* Select the **PagerDuty** trigger type.
* Click **Create Workflow**
* ![](https://2168485084-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXYvxfYq9m2JdKqaCdk%2Fuploads%2FvZBOqiQ7bTmLwmhpYmlz%2Fimage.png?alt=media\&token=e8eb7479-5b9d-4486-966f-f59dad5b7641)

#### Configure the automatic execution of a workflow <a href="#fylamynt-task-management" id="fylamynt-task-management"></a>

To automatically run workflows with the PagerDuty Alert trigger, the incident type and assignment need to be configured. Follow the step-by-step instructions provided on the[ Incident Management - Automatic workflow execution](https://docs.fylamynt.com/getting-started-1/7.-incident-management-automatic-workflow-execution) page.

### PagerDuty Create Incident

Use the action to create an incident in PagerDuty

**Input**

| **Parameter Name** | **Description**                                                                            | **Required** |
| ------------------ | ------------------------------------------------------------------------------------------ | ------------ |
| Incident Title     | Add a title for PagerDuty Incident                                                         | True         |
| PagerDuty Service  | Select a PagerDuty Service                                                                 | True         |
| Escalation Policy  | Select a PagerDuty Escalation Policy                                                       | True         |
| From User          | The email address of a valid user associated with the PagerDuty account making the request | True         |

**Output**

| **Parameter Name** | **Type** | **Description**                                                                  |
| ------------------ | -------- | -------------------------------------------------------------------------------- |
| created\_at        | String   | The date/time the incident was first triggered                                   |
| incident\_id       | String   | id of the incident                                                               |
| title              | String   | A succinct description of the nature, symptoms, cause, or effect of the incident |
| incident\_number   | Integer  | The number of the incident. This is unique across your account                   |
| status             | String   | The current status of the incident                                               |

**Action Example**

* Drag and drop the PagerDuty Create Action node onto the Workflow Editor Canvas
* Select the Action node
* Provide Incident title&#x20;
* Select PagerDuty service from the dropdown
* Select Escalation Policy from the dropdown
* Select the User to create PagerDuty incident

![](https://2168485084-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXYvxfYq9m2JdKqaCdk%2Fuploads%2F6XcRz26rpskEJwDsOh50%2Fimage.png?alt=media\&token=6ac26eb4-bbb8-4bdf-817f-8ee7fc2e0105)

### **PagerDuty Resolve Incident**

Use the action to resolve an incident in PagerDuty

**Input**

| **Parameter Name**    | **Description**                                                                            | **Required** |
| --------------------- | ------------------------------------------------------------------------------------------ | ------------ |
| PagerDuty Incident Id | ID of PagerDuty incident                                                                   | True         |
| From User             | The email address of a valid user associated with the PagerDuty account making the request | True         |
| Add Note              | Add a note or resolve message to incident                                                  | False        |

\
**Output**

| **Parameter Name** | **Type** | **Description**                                                                  |
| ------------------ | -------- | -------------------------------------------------------------------------------- |
| incident\_id       | String   | id of the incident                                                               |
| title              | String   | A succinct description of the nature, symptoms, cause, or effect of the incident |
| incident\_number   | Integer  | The number of the incident. This is unique across your account                   |
| status             | String   | The current status of the incident                                               |

**Action Example**

* Drag and drop the PagerDuty Resolve Action node onto the Workflow Editor Canvas
* Select the Action node
* Provide the PagerDuty Incident ID
* Select the User
* Optionally, add a note

![](https://2168485084-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXYvxfYq9m2JdKqaCdk%2Fuploads%2FAwKDeuEOGwuOJdQ5AKZZ%2Fimage.png?alt=media\&token=b39facb1-c634-448f-8144-13042e26260e)
