Use Cases
Common Use Cases
- Automated incident creation
- Severity-based routing
- Context-rich alerts
- Incident resolution tracking
Before You Begin
Prerequisites
- Datadog account with monitors configured
- PagerDuty account with services set up
- Escalation policies defined
Walkthrough
Step-by-Step Guide
1
Configure Datadog MCP Server
Set up with your Datadog API and application keys.
2
Configure PagerDuty MCP Server
Set up with your PagerDuty API key.
3
Map Alert Severity
Define how Datadog alert priorities map to PagerDuty severity levels.
4
Create Incident on Alert
When a Datadog monitor triggers, create a PagerDuty incident with full context.
async function handleDatadogAlert(alert) {
const severity = mapSeverity(alert.priority);
const context = await datadog.getMonitorDetails({ monitorId: alert.monitor_id });
await pagerduty.createIncident({
title: alert.title,
service_id: mapService(alert.tags),
urgency: severity === "critical" ? "high" : "low",
body: { type: "incident_body", details: `Monitor: ${context.name}\nQuery: ${context.query}\nValue: ${alert.value}\nThreshold: ${context.threshold}` }
});
}5
Auto-Resolve
When the Datadog monitor recovers, automatically resolve the PagerDuty incident.
Examples
Code Examples
typescript
Severity Mapper
function mapSeverity(datadogPriority) {
const map = { P1: "critical", P2: "error", P3: "warning", P4: "info" };
return map[datadogPriority] || "warning";
}Help
Troubleshooting
How do I prevent alert storms?+
Can I add runbook links?+
Quick Info
DifficultyIntermediate
Time Estimate45 minutes
Tools
Datadog MCP ServerPagerDuty MCP Server