Set up the PagerDuty plugin

Published on August 26th, 2022

Introduction

The PagerDuty Backstage plugin allows Roadie Backstage users to:

  1. See who is on call for a particular catalog Component.
  2. See if there are active incidents for a given catalog Component.
  3. Create new incidents from Backstage.

PagerDuty plugin in Roadie Backstage

In order to use the PagerDuty plugin, Roadie needs an API token to communicate with it’s APIs.

This page describes how to create and set up the API token.

Steps

Step 1: Create an API token

Inside PagerDuty, access “API Access Keys” inside the “Integrations” menu.

API Access menu Item on PagerDuty integrations menu

On the API Access Keys page, click the “Create New API Key” button.

Create new api key button

Set a sensible description and click “Create Key”.

Create key modal

ℹ️ The PagerDuty Backstage plugin allows users to create PagerDuty incidents from within Backstage. For this reason, the API key needs both read and write permissions to function correctly.

Copy the key that is created to your clipboard.

Step 2: Store the credentials in Roadie

Visit the following URL and enter the API Key value from above into PAGERDUTY_TOKEN.

https://<tenant-name>.roadie.so/administration/settings/secrets

ℹ️ Roadie accepts the token from PagerDuty unmodified. The configuration steps for the PagerDuty plugin in self-hosted Backstage are more complex, and will not work in Roadie.

Step 3: Add the PagerDuty annotation

Backstage requires a PagerDuty annotation on every component which will display the PagerDuty plugin. The annotation key is pagerduty.com/integration-key.

This example shows how it might look on a Backstage component:

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: sample-service
  title: Sample Service
  description: A sample service
  annotations:
    pagerduty.com/integration-key: <sample-service-integration-key>
spec:
  type: service
  owner: sample-team
  lifecycle: experimental

To generate the PagerDuty integration key, find a “Service” in the PagerDuty Service Directory and view the Integrations tab.

integrations tab

Click the Add an integration link. Choose Events API V2, and click the Add button.

Integrations list

You should now be redirected back to the Integrations tab, and a new integration should have been created. You can edit the integration name to indicate that this is a Roadie Backstage integration.

Created integration

Copy the Integration Key and add it to the Component YAML.

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: sample-service
  title: Sample Service
  description: A sample service
  annotations:
    pagerduty.com/integration-key: c5dd2b278fdc4d01d0a4a02b25c1ccc1
spec:
  type: service
  owner: sample-team
  lifecycle: experimental

Commit and merge this change and the Roadie Backstage PagerDuty plugin should begin working shortly afterwards.

References