PagerDuty data source
The PagerDuty data source plugin allows you to query incident data from PagerDuty and visualize it in Grafana dashboards. You can list and filter incidents, retrieve individual incident details, and overlay incidents as annotations on other data.
Note
The PagerDuty data source is an Enterprise plugin. It’s available with a Grafana Cloud Pro or Advanced plan and Grafana Enterprise. For installation instructions, refer to Install Grafana Enterprise plugins.
Supported features
The following table lists the features supported by the PagerDuty data source.
Before you begin
Before configuring the PagerDuty data source, ensure you have:
- A Grafana Cloud Pro or Advanced plan or an activated on-prem Grafana Enterprise license. Self-hosted installations require Grafana version 11.6.7 or later.
- A PagerDuty account with a REST API key. Refer to the PagerDuty REST API Keys documentation for instructions on generating an API key. Because this plugin only reads data from PagerDuty, prefer generating a read-only API key.
- Grafana permissions:
Organization administratorrole to add and configure data sources.
Configure the data source
To start querying PagerDuty data, add and configure the data source in Grafana.
Add the data source
To add the PagerDuty data source:
- Click Connections in the left-side menu.
- Click Add new connection.
- Type
PagerDutyin the search bar. - Select PagerDuty.
- Click Add new data source.
Authentication
The PagerDuty data source authenticates using an API key.
Optional settings
The following optional settings are available under Optional Settings in the configuration editor.
Verify the connection
Click Save & test to verify that the data source is configured correctly. A successful connection displays the message PagerDuty API datasource connected successfully.
Provision the data source
You can define the PagerDuty data source in YAML files as part of Grafana’s provisioning system. For more information, refer to Provisioning Grafana data sources.
apiVersion: 1
datasources:
- name: PagerDuty
type: grafana-pagerduty-datasource
jsonData:
auth:
id: api_key
secureJsonData:
auth.api_key.apiKey: <API_KEY>You can also provision the data source using the Grafana Terraform provider:
resource "grafana_data_source" "pagerduty" {
type = "grafana-pagerduty-datasource"
name = "PagerDuty"
json_data_encoded = jsonencode({
auth = {
id = "api_key"
}
})
secure_json_data_encoded = jsonencode({
"auth.api_key.apiKey" = var.pagerduty_api_key
})
}Query the data source
The query editor has the following controls:
- Category – Select the query category. PagerDuty has a single category: Incidents.
- Action – Select the operation to perform from the drop-down.
- Additional parameters (optional) – Expand this collapsible section to configure filters and options. For List incidents, this section starts collapsed.
- Transformation options – Expand this collapsible section to select which fields to return.
List incidents
The List incidents action retrieves a paginated list of incidents. By default, the Since and Until parameters use the dashboard time range variables ${__from:date} and ${__to:date}, returning only incidents created within the selected time frame. Clear these fields to query all incidents.
Expand the Additional parameters (optional) section to configure the following filters.
Example: Monitor unresolved incidents by service
To build a table showing all currently open incidents for a specific service:
- Select List incidents from the Action drop-down.
- Set Statuses to
triggeredandacknowledged. - Enter your PagerDuty service ID in the Service IDs field.
- Set Sort by to
created_at:descto show the most recent incidents first. - Expand Transformation options and select the following fields under Select fields:
title,status,urgency,created_at, andhtml_url. - Choose the Table visualization to display the results.
Example: Track incident volume over time
To visualize how many incidents your team handles over time:
- Select List incidents from the Action drop-down.
- Set the dashboard time range to the period you want to analyze (for example, Last 30 days).
- Enter your team ID in the Team IDs field.
- Expand Transformation options and select
created_atandstatusunder Select fields. - Choose the Bar chart or Time series visualization.
- Use a Group by transformation to aggregate incident counts by day or week.
Example: View high-urgency incidents across all services
To create an overview of high-urgency incidents that need immediate attention:
- Select List incidents from the Action drop-down.
- Set Urgencies to
high. - Set Statuses to
triggered. - Clear the Since and Until fields to return incidents regardless of when they were created.
- Expand Transformation options and select:
title,service,created_at,escalation_policy, andhtml_urlunder Select fields. - Choose the Table visualization and use the
html_urlfield to link directly to each incident in PagerDuty.
Get an incident
The Get an incident action retrieves detailed information about a single incident. The required Id field appears under the Parameters section.
Select fields
Expand the Transformation options section and use the Select fields drop-down to choose which fields to include in the query results. If no fields are selected, all available fields are returned.
Available fields for List incidents include: id, summary, type, self, html_url, incident_number, title, description, created_at, updated_at, status, incident_key, service, assignments, assigned_via, last_status_change_at, resolved_at, first_trigger_log_entry, alert_counts, is_mergeable, escalation_policy, teams, pending_actions, acknowledgements, alert_grouping, last_status_change_by, priority, resolve_reason, incidents_responders, responder_requests, and urgency.
The Get an incident action supports the same fields except description, and additionally includes conference_bridge.
The fields created_at, updated_at, resolved_at, and last_status_change_at are automatically parsed as timestamps.
Annotations
You can use annotations to overlay PagerDuty incidents on other dashboard panels. This helps you correlate incidents with metrics and logs from other data sources.
To add a PagerDuty annotation:
- Open your dashboard and click Settings (gear icon).
- Select Annotations and click Add annotation query.
- Select the PagerDuty data source.
- Choose List incidents from the Action drop-down.
- Configure any filters you need, such as Statuses or Service IDs.
- Click Save dashboard.
Incidents are mapped to annotations using the timestamp fields (created_at, updated_at, resolved_at, or last_status_change_at). Use the Select fields drop-down under Transformation options to control which fields appear in the annotation tooltip.
Example: Correlate incidents with infrastructure metrics
To overlay PagerDuty incidents on a time series panel that shows CPU or memory usage from another data source:
- Create a dashboard panel with your infrastructure metrics (for example, from Prometheus or CloudWatch).
- Open Dashboard settings > Annotations and click Add annotation query.
- Select the PagerDuty data source.
- Choose List incidents from the Action drop-down.
- Set Service IDs to the service that matches the infrastructure being monitored.
- Set Statuses to
triggeredandacknowledgedto show only active incidents. - Expand Transformation options and select
titleandstatusunder Select fields so the annotation tooltip shows useful context. - Click Save dashboard.
Incident markers now appear on the time series panel, making it easy to see whether a spike in resource usage corresponds to a PagerDuty incident.
For more information about annotations, refer to Annotate visualizations.
Template variables
Template variables let you create dynamic, reusable dashboards. You can use the PagerDuty data source as a query variable source.
To create a PagerDuty query variable:
- Navigate to Dashboard settings > Variables.
- Click Add variable.
- Select Query as the variable type.
- Select the PagerDuty data source.
- Choose an action from the Action drop-down (for example, List incidents).
- Use the Select fields drop-down to choose which fields to return.
Note
The first two fields selected under Select fields are used as the variable label and value, respectively. If only one field is selected, it’s used for both. For example, to create a variable that holds incident IDs with human-readable labels, select
titleandidso the incident title displays as the label and the incident ID is used as the value.
After creating a variable, reference it in your PagerDuty queries using variable syntax. For more information, refer to Templates and variables.
Example: Filter incidents by variable
To create a dashboard where users can select an incident from a drop-down and view its details:
- Create a query variable named
incidentusing the PagerDuty data source. - Select List incidents from the Action drop-down.
- Under Select fields, choose
summaryfirst (label), thenid(value). - In your panel query, select Get an incident from the Action drop-down and enter
$incidentin the Id field.
When users select an incident from the dashboard drop-down, the panel updates to show that incident’s details.
Example: Filter by status using a custom variable
To let users toggle between viewing triggered, acknowledged, or resolved incidents:
- Navigate to Dashboard settings > Variables and click Add variable.
- Select Custom as the variable type.
- Name the variable
status. - Enter
triggered,acknowledged,resolvedin the Custom options field. - Enable Multi-value to allow users to select more than one status.
- In your panel query, select List incidents from the Action drop-down and enter
$statusin the Statuses field.
The dashboard drop-down now lets users control which incident statuses are displayed.
Alerting
You can create Grafana alert rules that query PagerDuty incident data. For example, you can alert when the number of triggered incidents exceeds a threshold or when high-urgency incidents remain unacknowledged.
To create an alert rule using PagerDuty data:
- Navigate to Alerting > Alert rules.
- Click New alert rule.
- Select the PagerDuty data source.
- Configure a List incidents query with the appropriate filters (for example, Statuses set to
triggeredand Urgencies set tohigh). - Add a Reduce expression to aggregate the results (for example, count rows).
- Add a Threshold expression to define the alert condition.
- Configure notification policies and contact points as needed.
For more information, refer to Grafana Alerting.
Plugin updates
Always ensure that your plugin version is up-to-date so you have access to all current features and improvements. Navigate to Plugins and data > Plugins to check for updates. Grafana recommends upgrading to the latest Grafana version, and this applies to plugins as well.
Note
Plugins are automatically updated in Grafana Cloud.


