Files
backstage/plugins/pagerduty
Samira Mokaram bc161fba4e add readme
2020-11-20 11:33:53 +01:00
..
2020-10-19 14:15:46 +02:00
2020-11-18 09:51:33 +01:00
2020-10-19 14:15:46 +02:00
2020-11-17 11:11:35 +01:00
2020-11-20 11:33:53 +01:00

PagerDuty

Overview

This plugin displays PagerDuty information about an entity such as if there are any active incidents and how the escalation policy looks like.

There is also an easy way to trigger an alarm directly to the person who is currently on-call.

This plugin requires that entities are annotated with an integration key. See more further down in this document.

This plugin provides:

  • A list of incidents
  • A way to trigger an alarm to the person on-call
  • Information details about the person on-call

Setup instructions

Install the plugin:

yarn add @backstage/plugin-pagerduty

Add it to the app in plugins.ts:

export { plugin as Pagerduty } from '@backstage/plugin-pagerduty';

Add it to the EntityPage.ts:

import {
  isPluginApplicableToEntity as isPagerDutyAvailable,
  PagerDutyCard,
} from '@backstage/plugin-pagerduty';
// add to code
{
  isPagerDutyAvailable(entity) && (
    <Grid item md={6}>
      <PagerDutyCard entity={entity} />
    </Grid>
  );
}

Client configuration

The PagerDutyClient can be configured with the appropriate urls:

In apis.ts:

createApiFactory({
  api: pagerDutyApiRef,
  deps: { configApi: configApiRef },
  factory: ({ configApi }) =>
    new PagerDutyClientApi({
      api_url: `https://api.pagerduty.com`,
      events_url: 'https://events.pagerduty.com/v2',
  }),
}),

Providing the API Token

In order for the client to make requests to the PagerDuty API it needs an API Token.

Then start the backend passing the token as an environment variable:

$ PAGERDUTY_TOKEN='Token token=<TOKEN>' yarn start

This will proxy the request by adding Authorization header with the provided token.

Integration Key

The information displayed for each entity is based on the integration key.

Adding the integration key to the entity annotation

If you want to use this plugin for an entity, you need to label it with the below annotation:

annotations:
  pagerduty.com/integration-key: [INTEGRATION_KEY]