icon-unified.svg
Experience Center

PagerDuty Webhook Configuration Guide

This guide provides information on using PagerDuty for configuring webhooks for alerts in Digital Experience Monitoring. The instructions here provide a sample configuration that can be used to build on per user requirements.

  1. Create a PagerDuty account at www.pagerduty.com.
  2. On your PagerDuty account page, click Developer Mode.

  1. Click Create New App.

  1. The Build App page opens.
  2. On the Build App page, enter an AppName and Description. Choose the Category as Error Tracking and fill in other details.

  1. Click Save.
  2. The Configure App page opens.
  3. Under Events Integration, click Manage.

  1. Choose Yes for Event Integration and enter the event transformation script.

  • export function transform(PD) {
                                          // Sample Event Transformation
                                          let body = PD.inputRequest.body;
                                          let zdxLinkURL = body.zdxUrl;
                                          let emitEv = true;
                                         
                                          let ruleName = body.ruleName;
                                         
                                          if (ruleName.toLowerCase() == "test")
                                            emitEv = false;
                                         
                                          let payloadCount = "\n\n";
                                         
                                          if ( body.status == "STARTED" ) {
                                            payloadCount += "Affected: \nGeolocations: " +  
                                                            body.geolocationCount + "\nDepartments: " + 
                                                            body.deptCount + "\nImpacted Devices: " + 
                                                            body.impactedDeviceCount + "\nOS Versions: " + 
                                                            body.osverCount
                                          }
                                         
                                          let normalized_event = {
                                            event_action: PD.Trigger,
                                            // optionally include a key to prevent creating duplicate
                                            // incidents when the same event is sent more than once
                                            // dedup_key: body.event_key,
                                         
                                         
                                            payload: {
                                              summary: `Rule: ${body.ruleName}, Severity: ${body.severity} ${body.status}`,
                                              source: 'ZDX',
                                              severity: PD.Critical,
                                              custom_details: `AlertId: ${body.alertId}\nRule Name: ${body.ruleName}\nSeverity: ${body.severity}\nCriteria: ${body.criteriaString}\nLink: ${zdxLinkURL} ${payloadCount}`
                                            },
                                            dedup_key: "",
                                         
                                            // optionally display links or images on web and mobile
                                            links: [{
                                              "href": zdxLinkURL,
                                              "text": "Alert Details"
                                            }],
                                          };
                                         
                                          if ( emitEv)
                                            PD.emitEventsV2([normalized_event]);
                                        }
                                        
    Close
  1. Copy the Events API Endpoint address as the URL to send webhooks to in the Admin Portal. No token is used, so you can select Token authentication on Digital Experience Monitoring and enter any string. Then, click Save on the Pager Duty Events Integration page.

  1. Once an alert is raised from Digital Experience Monitoring, an incident will be raised in PagerDuty.

Related Articles
Microsoft Teams Webhook Configuration GuideOpsGenie Webhook Configuration GuidePagerDuty Webhook Configuration GuideSlack Webhook Configuration GuideSplunk Webhook Configuration Guide