Prompt
How do I automate incident notifications to the right responders?
Latest observation
To automate incident notifications to the right responders, you want a system that can:
- Detect the incident,
- Classify it by type/severity/service,
- Route it to the correct on-call people,
- Escalate if nobody responds,
- Track acknowledgments and resolution.
Here’s a practical way to set it up.
1) Define routing rules first
Start by deciding who should be notified for what.
Typical routing dimensions:
- Service/component: payments, auth, API, database
- Severity: Sev1, Sev2, Sev3
- Environment: prod vs staging
- Incident type: latency, outage, security, data loss
- Ownership team: platform, backend, SRE, security
Example:
payment-api + prod + Sev1→ on-call backend + SRE managerauth-service + security-related→ security on-calldatabase + high error rate→ DBA/on-call infra
Keep the rules simple and explicit.
2) Maintain an up-to-date responder directory
Your automation is only as good as your ownership data.
Create a source of truth with:
- Team name
- Service ownership
- Primary on-call
- Secondary on-call
- Escalation chain
- Time zone / working hours
- Notification channels
This can live in:
- PagerDuty / Opsgenie / xMatters
- A CMDB / service catalog
- A YAML/JSON config in Git
- A database table if you’re building your own system
Example record:
{
"service": "payment-api",
"severity": "sev1",
"primary": "oncall-backend",
"secondary": "sre-oncall",
"escalation_after_minutes": 10
}
3) Trigger notifications from your monitoring/incident signals
Integrate your alert sources:
- Monitoring: Datadog, Prometheus, CloudWatch
- Logging: ELK, Splunk
- APM: New Relic, Dynatrace
- Security tools: SIEM, EDR
- Ticketing: Jira, ServiceNow
- Status page / synthetic checks
When an alert fires, pass along metadata like:
- Service name
- Alert type
- Severity
- Region
- Runbook link
- Incident ID
- Suggested owner/team
This metadata is what lets you route intelligently.
4) Build a routing layer
A routing layer maps alert metadata to responders.
Basic logic
- Match by service ownership
- Then severity
- Then incident type
- Then environment
Example routing decision
If alert contains:
service = authseverity = sev2type = auth_failure
Route to:
- Auth team primary on-call
- If unresolved after 10 min, escalate to auth lead
- If security indicator present, notify security on-call too
Implementation options
- Tool-native routing: PagerDuty/Opsgenie rules
- Webhook automation: alert → Lambda/Cloud Function → routing engine
- Event bus: alert → Kafka/SQS/PubSub → notification service
A simple rule engine can work well:
if service == "payments" and severity == "sev1" then page payments-oncallif security_tag == true then page security-oncall
5) Use escalation policies
Don’t stop at the first notification.
A solid escalation policy:
- Notify primary on-call via push/SMS/call
- If no acknowledgment in 5–10 minutes, notify secondary
- If still unacknowledged, notify manager/incident commander
- If critical, page multiple people in parallel
Include:
- acknowledgment timeout
- retry interval
- fallback contacts
- quiet-hours policy
6) Avoid over-notifying
To make automation usable, add filters:
- Deduplicate repeated alerts
- Group related alerts into one incident
- Suppress known noisy alerts during maintenance windows
- Route low-priority issues to chat/ticket instead of paging
- Enforce severity thresholds before paging humans
Good incident notification systems minimize alert fatigue.
7) Add context to every notification
A responder should get enough information to act immediately.
Include:
- What happened
- What service is affected
- Severity
- Start time
- Impact
- Suspected cause
- Runbook link
- Dashboards/logs
- Owner/team
- Incident channel / bridge link
Example message:
Sev1: payment-api elevated 5xx rate in prod (us-east-1)
Impact: checkout failures for ~20% of users
Owner: Payments on-call
Runbook: link
Dashboard: link
Acknowledge here: link
8) Use intelligent enrichment
Before notifying, enrich alerts with:
- Service owner from service catalog
- Recent deploys
- Related alerts
- Affected region/customer segment
- Similar historical incidents
- CMDB dependencies
This can improve routing accuracy:
- If a deploy just happened, route to the release owner
- If database latency is the root cause, notify the DB team too
9) Integrate with incident management workflows
Once the incident is opened:
- Create an incident ticket automatically
- Create a dedicated chat channel
- Assign an incident commander
- Add responders automatically based on playbook
- Update status page if external impact exists
This reduces manual coordination.
10) Measure and tune
Track:
- Mean time to acknowledge (MTTA)
- Mean time to resolve (MTTR)
- Missed pages
- False positives
- Escalation frequency
- Incorrect routing rate
Then refine:
- ownership mappings
- severities
- alert thresholds
- escalation timeouts
A simple architecture
Alert source → Normalizer → Router → Notification provider → Escalation engine → Incident workflow
Example stack:
- Prometheus/Datadog alert
- Webhook to AWS Lambda
- Lambda looks up service ownership in DynamoDB/Git config
- Sends page via PagerDuty
- PagerDuty handles escalation and acknowledgments
- Jira ticket and Slack channel created automatically
If you want the fastest path
Use a managed incident tool:
- PagerDuty
- Opsgenie
- xMatters
- FireHydrant
- Rootly
These already support:
- routing rules
- schedules
- escalation policies
- deduplication
- incident workflows
Recommended starting plan
- Inventory services and owners
- Define severity levels
- Set up on-call schedules
- Create routing rules
- Integrate monitoring alerts
- Add escalation and deduplication
- Test with a few simulated incidents
- Tune based on real pages
If you want, I can also help you design:
- a PagerDuty/Opsgenie routing setup,
- a YAML-based incident router, or
- a simple code example in Python or Node.js.