PagerDuty Integration
Automatically create, manage, and escalate database incidents through PagerDuty's incident management platform.
Overview
The DB24x7 PagerDuty integration enables seamless incident management for critical database issues. Automatically create incidents, notify on-call engineers, and track resolution through PagerDuty's robust incident response workflow.
Auto-Incident Creation
Automatically trigger PagerDuty incidents for critical database alerts
Smart Escalation
Leverage escalation policies to route incidents to the right team
Bi-directional Sync
Sync incident status between DB24x7 and PagerDuty
API Key Setup
Step 1: Create Integration Key in PagerDuty
- Log in to your PagerDuty account
- Navigate to Services → Service Directory
- Select the service you want to integrate with DB24x7 (or create a new one)
- Go to the Integrations tab
- Click Add Integration
- Select Events API v2 as the integration type
- Copy the Integration Key
Step 2: Configure in DB24x7
- Navigate to DB24x7 Dashboard → Settings → Integrations
- Click Connect PagerDuty
- Paste your Integration Key
- Configure incident creation rules (see below)
- Click Save Configuration
Integration Key Format
INTEGRATION_KEY=R0abc123DEF456GHI789JKL012MNO345Keep this key secure. It allows DB24x7 to create and update incidents in your PagerDuty service.
Alternative: OAuth 2.0 Setup
For enhanced security and more granular permissions, you can use OAuth 2.0:
- In PagerDuty, go to Integrations → Developer Mode
- Create a new OAuth application
- Set the redirect URI to:
https://api.db24x7.com/integrations/pagerduty/callback - Copy the Client ID and Client Secret
- In DB24x7, select OAuth authentication and paste credentials
- Complete the OAuth authorization flow
Service Configuration
Incident Creation Rules
Configure which database alerts should automatically create PagerDuty incidents:
{
"incident_rules": {
"critical_alerts": {
"create_incident": true,
"urgency": "high",
"auto_resolve": false
},
"warning_alerts": {
"create_incident": false,
"urgency": "low",
"auto_resolve": true
},
"database_down": {
"create_incident": true,
"urgency": "high",
"auto_resolve": false,
"escalate_after": "5m"
},
"slow_queries": {
"create_incident": true,
"urgency": "low",
"threshold": "5s",
"auto_resolve": true
}
}
}Service Mapping
Map different databases to specific PagerDuty services:
{
"service_mapping": {
"production-postgres": {
"integration_key": "R0abc123DEF456GHI789JKL012MNO345",
"service_id": "PSERVICE1"
},
"production-mysql": {
"integration_key": "R1xyz789ABC012DEF345GHI678JKL901",
"service_id": "PSERVICE2"
},
"staging-*": {
"integration_key": "R2mno456PQR789STU012VWX345YZA678",
"service_id": "PSERVICE3"
}
}
}Incident Creation
Automatic Incident Payload
When a critical alert is triggered, DB24x7 sends the following payload to PagerDuty:
{
"routing_key": "R0abc123DEF456GHI789JKL012MNO345",
"event_action": "trigger",
"payload": {
"summary": "Database CPU Usage Critical - production-postgres-01",
"source": "db24x7",
"severity": "critical",
"timestamp": "2026-02-07T10:30:00Z",
"component": "database",
"group": "production",
"class": "performance",
"custom_details": {
"database": "production-postgres-01",
"metric": "cpu_usage",
"current_value": "95%",
"threshold": "80%",
"duration": "5 minutes",
"affected_queries": 23,
"suggested_action": "Terminate long-running query ID: 12345",
"dashboard_link": "https://app.db24x7.com/databases/prod-pg-01/metrics"
}
},
"dedup_key": "db24x7-prod-pg-01-cpu-2026-02-07-10-30",
"links": [
{
"href": "https://app.db24x7.com/incidents/inc-12345",
"text": "View in DB24x7 Dashboard"
}
]
}Auto-Resolution
When an issue is resolved by DB24x7's self-healing agent, the incident is automatically resolved in PagerDuty:
{
"routing_key": "R0abc123DEF456GHI789JKL012MNO345",
"event_action": "resolve",
"dedup_key": "db24x7-prod-pg-01-cpu-2026-02-07-10-30",
"payload": {
"summary": "Issue resolved by DB24x7 AI DBA",
"timestamp": "2026-02-07T10:35:00Z",
"custom_details": {
"resolution_method": "automated",
"action_taken": "Terminated long-running query ID: 12345",
"time_to_resolution": "5 minutes"
}
}
}Escalation Policies
Escalation policies are managed entirely within PagerDuty. Configure your escalation rules in PagerDuty to ensure incidents reach the right people at the right time.
Recommended Escalation Setup
Primary on-call database administrator notified immediately for critical incidents
Escalate to team lead if no acknowledgment after 15 minutes
Final escalation to engineering management for unresolved critical incidents
Priority-Based Routing
Configure DB24x7 to use different escalation policies based on incident severity:
{
"escalation_mapping": {
"critical": "ESCALATION_POLICY_ID_1",
"high": "ESCALATION_POLICY_ID_1",
"medium": "ESCALATION_POLICY_ID_2",
"low": "ESCALATION_POLICY_ID_3"
}
}Best Practices
Recommended Setup
- Create separate PagerDuty services for production and non-production databases
- Use deduplication keys to prevent duplicate incidents for the same issue
- Enable auto-resolution to reduce manual overhead
- Configure appropriate escalation timeouts based on your SLAs
- Use PagerDuty's Event Rules to enrich incident data
- Set up incident response plays for common database issues
Testing Your Integration
Before going live, test your PagerDuty integration:
- Use DB24x7's "Test Integration" button to send a test incident
- Verify the incident appears in PagerDuty with correct details
- Confirm escalation policies trigger as expected
- Test auto-resolution by resolving the test incident in DB24x7
- Review incident data in PagerDuty's Analytics for completeness
Troubleshooting
Incidents not being created?
- Verify the integration key is correct and active
- Check that the PagerDuty service status is active
- Review DB24x7 audit logs for API error responses
- Confirm incident creation rules match your alert types
- Ensure the Events API v2 integration is enabled in PagerDuty
Auto-resolution not working?
- Check that dedup_key matches between trigger and resolve events
- Verify auto_resolve is enabled in your incident rules configuration
- Review PagerDuty event logs for resolve event delivery
- Confirm the incident is in "triggered" or "acknowledged" state
Wrong escalation policy being used?
- Verify the service's default escalation policy in PagerDuty
- Check service mapping configuration for correct service IDs
- Ensure incident urgency levels are properly configured
- Review PagerDuty's Event Rules for any overrides