**Situation & Objective**Automated runbook to detect/mitigate failed cutover where API latency and error rate exceed thresholds, and to escalate, collect RCA data, and communicate to stakeholders.**Automated Detection & Alerts**- Metrics & thresholds (CloudWatch/Stackdriver/Prometheus): - 95th pct latency > 800 ms for 5m - Error rate (5xx) > 3% for 2m - Request success rate drop > 5% vs baseline- Alerts: - P1 Pager duty (immediate) - Slack #oncall with runbook link - Email to SRE leads if persists > 10m**Automatic Mitigations (run inline)**1. Circuit breaker: toggle Envoy/HAProxy or feature-flag to reduce retries & reject new requests- Sample feature-flag toggle (curl to LaunchDarkly API)bash
# toggle feature flag to disable new traffic to v2
curl -X PATCH "https://app.launchdarkly.com/api/v2/flags/{proj}/{flag}" \
-H "Authorization: Bearer $LD_TOKEN" \
-H "Content-Type: application/json" \
-d '{"environments":{"production":{"on":false}}}'
2. Traffic shift: rollback or weighted routing to previous stable service- AWS Route53 weighted update to shift traffic back to blue targetbash
aws route53 change-resource-record-sets --hosted-zone-id Z123 \
--change-batch '{
"Changes":[{"Action":"UPSERT","ResourceRecordSet":{
"Name":"api.example.com","Type":"A",
"SetIdentifier":"stable","Weight":90,"TTL":60,
"ResourceRecords":[{"Value":"1.2.3.4"}]
}}]}'
3. Auto-scale temporary capacity: increase ALB target capacity or scale-out ECS tasks**Operator Escalation Steps**1. Acknowledge alert; run automated mitigations (scripts above).2. If mitigations succeed (latency & errors normalize within 5m) — monitor 30m, postmortem.3. If not: escalate to Cloud Eng lead and Product Owner; open incident ticket; prepare rollback to previous release and DNS/route rollback.4. If partial outage persists >30m, engage Exec comms.**RCA & Logs to Collect**- Aggregated traces (X-Ray / Jaeger) for 1h before/after cutover- Application logs (structured JSON) and stderr for affected services- ALB/NGINX access logs, 5xx entries, response times- Metrics: CPU/memory, GC, thread pools, DB latencies, connection counts- Deployment pipeline logs (CI/CD), feature flags, infra changes- Network flow logs (VPC flow / Cloud NAT), DNS change history**Communications Templates**- Initial incident (Slack/Email) - Subject: P1 — API latency spike after cutover — Investigating - Body: Short summary, time, mitigation in progress (traffic shift/circuit breaker), expected updates every 15m, named on-call.- Customer status update - "We detected elevated API errors after today's cutover at 14:03 UTC. We have temporarily shifted traffic to the previous stable service and are monitoring. No data loss expected. Next update in 30 minutes."- Post-incident report - Timeline, root cause, mitigations executed, action items, owner, SLA impact.**Runbook Testing & Ownership**- Automated chaos tests in staging to validate circuit-breaker and weighted routing- Weekly playbook drills; owner: Cloud Engineering Lead; maintain runbook in runbooks repo with executable scripts and CI-checks.This runbook balances automation (fast mitigations) with clear escalation, ensures required telemetry for RCA, and provides ready-to-send communications.