PagerDuty
Overview¶
OpenSRE queries PagerDuty for active incidents, timelines, on-call responders, and service / escalation-policy configuration so the agent can correlate incident management data with infrastructure events.
Prerequisites¶
- PagerDuty account
- REST API key with read access
Setup¶
Option 1: Interactive CLI¶
Provide your API key when prompted.
Option 2: Environment variables¶
| Variable | Default | Description |
|---|---|---|
PAGERDUTY_API_KEY |
— | Required. PagerDuty REST API v2 key |
PAGERDUTY_BASE_URL |
https://api.pagerduty.com |
Override only for EU or custom instances |
Option 3: Persistent store¶
{
"version": 1,
"integrations": [
{
"id": "pagerduty-prod",
"service": "pagerduty",
"status": "active",
"credentials": {
"api_key": "your-api-key"
}
}
]
}
Credentials¶
- In PagerDuty, go to Integrations → Developer Tools → API Access Keys
- Click Create New API Key
- Add a description (for example
opensre read-only) - Copy the key immediately — it is shown only once
Info
PagerDuty API keys are account-level. Use a read-only key for least privilege.
Tools¶
| Tool | Description |
|---|---|
pagerduty_incidents |
List and search incidents (status, urgency, service, time range) |
pagerduty_incident_detail |
Full incident details and activity timeline (log entries) |
pagerduty_oncall |
Current on-call responders by escalation policy |
pagerduty_services |
Services with escalation policies, integrations, and alert routing |
When investigating an incident, OpenSRE may use these tools to:
- Find incidents around the alert time window
- Identify who was on-call and how quickly incidents were acknowledged
- Map services and escalation policies involved
- Correlate PagerDuty timelines with Grafana / Datadog metrics
Verify¶
Expected output:
Troubleshooting¶
| Symptom | Fix |
|---|---|
| 401 Unauthorized | Check the API key — use a valid REST API v2 key |
| 403 Forbidden | The key may lack required permissions; recreate with full read access |
| 429 Rate Limited | PagerDuty limits apply (about 960 requests/min); reduce query frequency |
| No incidents returned | Check time-range filters — default returns recent incidents only |
Security¶
- Use a read-only API key — OpenSRE does not need to modify PagerDuty resources.
- Store the API key in
.envor your secret manager — not in source control. - Rotate API keys periodically via PagerDuty Developer Tools.
Markdown source: View on AtomGit·Content from the open-source project op/opensre