In an earlier post I discussed how to enable the alerting capabilities of Imply Pivot and send out alerts via email.

Today I am going to connect Pivot to PagerDuty, as an example of a custom webhook configuration. You need a PagerDuty account for this, but you can use the free 14 day trial for the tutorial. You also need to set up a few things in PagerDuty so you can use the Events API to receive alerts.

Preparing PagerDuty

In order to send alerts to PagerDuty, create a service in PagerDuty and an integration with the Events API v2. You find this in the Service Directory of PagerDuty:

Service Directory

After creating a service, add a new Events API integration to that service:

Service Directory Service Directory

Go to the settings for the integration

Integration Settings

and note down the Integration Key - you will need it in the next step.

Integration Key

Configuring the alert

In Pivot, set up an alert and configure it to use a webhook. For the "routing_key" field, use the integration key that you noted down before.

The URL for the Events API is https://events.pagerduty.com/v2/enqueue and your payload should look like this:

{ 
  "payload": { 
    "summary": "%summary%",
    "severity": "info",
    "source": "Imply News"
  },
  "routing_key": "<insert your integration key>",
  "event_action": "trigger"
}

Note how Pivot uses a placeholder to encode the report summary. You can find a list of the supported placeholders in the documentation.

You can set this up during alert creation, or edit an existing alert and configure the Delivery options. You also have the opportunity to send a test alert:

Pivot Alert Delivery Options

If you got everything right, you can see the alerts coming into your PagerDuty account:

Alerts incoming

Learnings

  • The webhook delivery mechanism of Imply Pivot is a powerful way to connect Pivot alerts to almost any application that supports a REST API.
  • Alert content is encoded in placeholders.
  • Some preparation is required on the PagerDuty side in order to receive Pivot alerts.