Skip to main content
This topic explains how to use the PagerDuty service integration to send LaunchDarkly observability alerts to PagerDuty. PagerDuty is an incident management and on-call platform. If your team manages on-call rotations in PagerDuty, this integration lets PagerDuty handle your LaunchDarkly alerts for you. You configure LaunchDarkly alerts to trigger PagerDuty alerts on the services you choose. LaunchDarkly resolves each PagerDuty alert when the LaunchDarkly alert that triggered it recovers, or when you turn that alert off. Whether a PagerDuty alert also opens an incident depends on the settings of your PagerDuty service.
The PagerDuty service integration is separate from the PagerDuty for guarded rollouts integration. Each integration has its own configurations and integration keys.

Prerequisites

To use the PagerDuty service integration, you need:

Get the PagerDuty integration key

Each LaunchDarkly configuration connects to one PagerDuty service using an integration key from that service. To get an integration key:
  1. In PagerDuty, open the service where you want to receive LaunchDarkly alerts.
  2. Add an Events API V2 integration to the service. To learn how, read Add integrations to an existing service in the PagerDuty documentation.
  3. Copy and save the integration key for use in the next section.

Configure the integration in LaunchDarkly

You can add more than one configuration. For example, to page different teams for different alerts, add a configuration for each team’s PagerDuty service. To configure the PagerDuty service integration:
  1. Click the gear icon in the left sidebar to view Organization settings.
  2. Click Integrations and find “PagerDuty service.”
  3. Click Add new.
  4. Enter a Name for the configuration. This name appears in the alert destination menu.
  5. Paste the PagerDuty integration key you copied from PagerDuty.
  6. After reading the Terms and Conditions, check the I have read and agree to the Integration Terms and Conditions checkbox.
  7. Click Save configuration.
LaunchDarkly stores the integration key as a secret.

Send alert notifications to PagerDuty

After you configure the integration, you can add PagerDuty as a notification destination for any observability alert. The destination menu lists only the PagerDuty service configurations that are turned on. To add PagerDuty as an alert notification destination:
  1. Click Observability > Alerts in the left sidebar.
  2. Click Create alert, or select Edit alert from an existing alert’s three-dot overflow menu.
  3. Click + Add notification.
  4. Click Add PagerDuty. A “PagerDuty services” section appears.
  5. Select one or more configurations from the Select services menu.
  6. Click Save.
If you have not configured a PagerDuty service yet, click + Add service. The PagerDuty service configuration page opens in a new tab and your changes to the alert stay in place. After you save the configuration, return to the alert and select the new service. When you add a PagerDuty destination to a new alert, LaunchDarkly turns on Notify on resolve for the alert. Keep this setting on to have LaunchDarkly resolve the PagerDuty alert when the LaunchDarkly alert resolves. If you turn it off, PagerDuty alerts stay open until you resolve them in PagerDuty. To learn more about creating and editing alerts, read Alerts.

Alert event payload

LaunchDarkly sends each alert event to PagerDuty in the PagerDuty Events API v2 format. The trigger event and the resolve event for the same alert group share a dedup_key. The resolve event resolves the PagerDuty alert that the trigger event opened. If the alert uses Group by, each group value produces a separate PagerDuty alert. The trigger event contains the following top-level fields:
  • routing_key: The integration key from the PagerDuty service configuration.
  • event_action: trigger.
  • dedup_key: A stable identifier for the alert and group.
  • payload.summary: The alert name. If the alert uses grouping, the summary also includes the group, such as Request rate (service=checkout).
  • payload.source: The name of the LaunchDarkly project.
  • payload.severity: error for an alert, warning for a warning, or info for a test notification.
  • payload.timestamp: When LaunchDarkly sent the event.
  • payload.custom_details: Additional information about the alert, described below.
  • client_url: A link to the alert in LaunchDarkly.
The custom_details object includes the following fields:
  • payload_version: The version of the payload format. The current version is 1.
  • alert_id, alert_name, project_key, and project_name: Identifiers for the alert and its LaunchDarkly project.
  • description: The alert’s notification message.
  • maintainer_team_key: The key of the team that maintains the alert. LaunchDarkly includes this field only when a team maintains the alert.
  • tags: The alert’s tags, as a list of strings. The list is empty if the alert has no tags.
  • product_type, query, and reason: The data source, query, and reason for the notification.
  • value, threshold_value, threshold_condition, threshold_type, and threshold_window_seconds: The observed value and the threshold configuration.
  • group_by_keys, group_by_value, and groups: The grouping keys and values for the series that triggered the alert.
  • started_at and timestamp: When the alert started and when LaunchDarkly sent the event.
Here is an example of a trigger event:

Route alerts to the owning team

Alert maintainer teams and tags are optional. If an alert has them, then its trigger events include them in custom_details. You can use PagerDuty Event Orchestration rules to route LaunchDarkly alerts or change their priority based on these fields, for example on event.custom_details.maintainer_team_key. To learn more, read Event Orchestration in the PagerDuty documentation.