Skip to content

Incident Runbook

Date: 2026-04-21 Owner: Platform Team Review frequency: Quarterly

SeverityImpactResponse TimeExamples
P0 / CriticalFull service down, data loss risk, security breach15 min, 24/7All instances down, DB corruption, secret leaked
P1 / HighMajor feature broken, >10% users affected1 hourAuth broken, CI queue stuck, storage unavailable
P2 / MediumFeature degraded, workaround exists4 hoursSlow UI, notifications delayed, intermittent errors
P3 / LowMinor issue, cosmeticNext sprintUI glitch, rare 500 errors, minor perf regression
Terminal window
# Check health endpoint
curl -s https://your-domain.com/api/health | jq .
# Check error rates
curl -s https://your-domain.com/api/metrics | grep -A5 http_requests_total
# Check recent logs
curl -s https://your-domain.com/api/metrics | grep error
# Check CI queue
curl -s https://your-domain.com/api/metrics | grep ci_queue
# Check active runners
curl -s https://your-domain.com/api/metrics | grep active_runners
  • What is the scope? (single user, single repo, all users)
  • What broke? (new deploy, dependency, external service)
  • Is there a workaround?
  • Check recent deploys: kubectl rollout history deployment/opencodehub
Terminal window
# Option A: Feature flag disable
kubectl set env deployment/opencodehub FEATURE_X_DISABLED=true
# Option B: Rollback (Docker)
docker run --rm swadhinbiswas/opencodehub:previous-tag
# Update docker-compose.yml with previous tag
docker compose -f docker-compose.production.yml up -d
# Option C: Scale up (if resource issue)
kubectl scale deployment/opencodehub --replicas=5
# Option D: Restart (if memory leak suspected)
kubectl rollout restart deployment/opencodehub
  • Create incident Slack thread in #incidents
  • Update status page at status.your-domain.com
  • Notify affected users within 15 min (P0) or 1 hour (P1)
  • Verify fix with health/metrics checks
  • Close incident in #incidents with summary
  • Create postmortem within 48 hours (P0/P1)
  1. Check docker-compose logs -f app
  2. Verify PostgreSQL is reachable: docker compose exec postgres pg_isready
  3. Check Redis is reachable: docker compose exec redis redis-cli ping
  4. Verify env vars are set correctly
  5. Check migrations ran: docker compose exec app bun run db:migrate
  1. Check which endpoints are failing
  2. Check DB query times
  3. Check external dependencies (S3, email, etc.)
  4. Check recent deploys
  5. Roll back if recent change
  1. Check active runners: curl -s /api/metrics | grep active_runners
  2. Check runner logs: kubectl logs -l runner=true
  3. Restart runner pods if needed
  4. Retry stuck jobs via admin API
  1. Check p95/p99 latencies from metrics
  2. Check DB slow queries: docker compose exec postgres pg_stat_statements
  3. Check Redis memory: docker compose exec redis redis-cli info memory
  4. Scale horizontally or add caching
  5. Check for stuck long-running jobs

Scenario 5: Database Connection Exhaustion

Section titled “Scenario 5: Database Connection Exhaustion”
  1. Check DB connections: docker compose exec postgres psql -c "SELECT count(*) FROM pg_stat_activity"
  2. Reduce connection pool size in env
  3. Restart app if needed
  4. Check for long-running transactions
ScenarioRTO (Recovery Time Objective)RPO (Recovery Point Objective)
Full outage< 30 min< 5 min data loss
Data corruption< 4 hours< 1 hour data loss
Security incident< 1 hour< 0 (preserve evidence)
RoleContact
Primary on-callCheck PagerDuty schedule
Backup on-callCheck PagerDuty schedule
DBA (PostgreSQL)Check escalation chain
Cloud infraAWS/GCP support portal