Error Alerting Policy
Sentry alert rules (configure in Sentry dashboard)
1. Error rate spike — critical
Trigger: > 10 new errors in 5 minutesAction: Email + Slack #alerts
Query:
level:error environment:production
2. New issue — high severity
Trigger: Any new issue with level =fatal or errorAction: Email immediately
Filter:
environment:production
3. Performance regression — p95 latency
Trigger: p95 transaction duration > 3000ms for/api/*Action: Email
4. Cron job failure
Trigger: Any error in transactionGET /api/cron/*Action: Email
Note: Vercel Cron fires at 2:30 UTC and 13:30 UTC daily
5. Auth errors
Trigger: > 5 events matchingsupabase.auth in 10 minutesAction: Slack #security-alerts
Sentry configuration (already in codebase)
sentry.server.config.ts, sentry.client.config.ts, sentry.edge.config.ts — Sentry is wired.
To add environment tagging, update sentry.server.config.ts:
Uptime monitoring
Use the/api/health endpoint with an external monitor:
Alert condition: HTTP status ≠ 200 OR response contains
"status":"error".
On-call rotation
Since this is a single-team product, a simple escalation path:- Automated alert fires → Slack/email
- No ack in 15 min → WhatsApp to primary dev
- No ack in 30 min → call secondary dev
Incident runbook
- Check
/api/health→ identify failing component - Check Vercel Functions logs for the affected route
- Check Supabase dashboard → Database → Logs for DB errors
- If DB: check connection pool usage (Supabase → Database → Connection Pooling)
- Roll back last deploy if needed: Vercel dashboard → Deployments → Promote previous