Onset Monitoring & Alerts¶
Core Signals¶
1) Backend Health¶
- Edge function success rate
daily-insight2xx rategenerate-protocol2xx rateclient-event2xx rate- Error buckets
- 401 auth failures
- 429 rate limits
- 5xx model/provider failures
2) Product Funnel Signals¶
From product_events and get_admin_dashboard_metrics:
paywallShownpaywallPurchaseCompletedfirstCheckInCompletedpremiumPreviewViewed- conversion ratio (
paywallPurchaseCompleted / paywallShown)
3) AI Quality / Reliability¶
daily-insighterror rate and median latency- model fallback frequency
- safety validation failure rate
Recommended Alert Thresholds¶
- SEV-1
daily-insight5xx > 20% for 10 minutesgenerate-protocol5xx > 20% for 10 minutes- launch crash spike above baseline after release
- SEV-2
- 401 auth failures > 5% for 15 minutes
- 429 rate limits > expected baseline for 30 minutes
- SEV-3
- conversion drop > 20% day-over-day without campaign/context explanation
Synthetic Checks¶
Run every 5-15 minutes from CI or external monitor:
- Anonymous auth signup
client-eventwrite checkdaily-insightrequest checkget_admin_dashboard_metricsresponse shape check
Use:
Destinations Configuration¶
Alert routing is implemented in onset-web:
- Endpoint:
POST /api/admin/alerts - Channels supported:
- Email (SendGrid):
ALERT_EMAIL_TO - Slack webhook:
ALERT_SLACK_WEBHOOK_URL - PagerDuty Events v2:
PAGERDUTY_ROUTING_KEY
Required auth/env in onset-web:
ONSET_ADMIN_ALERTS_TOKENONSET_API_URLONSET_API_ANON_KEYADMIN_DASHBOARD_SECRETSENDGRID_API_KEY
Optional email cadence env:
ALERT_EMAIL_WEEKLY_SUNDAY_ONLY(trueby default)- When
true, alert emails send only on the configured weekly day (UTC). ALERT_EMAIL_WEEKLY_DAY_UTC(0by default)- Day of week for weekly email sends (
0=Sunday,1=Monday, ...6=Saturday).
Optional AI abuse override env (Supabase Edge functions):
ONSET_INTERNAL_OVERRIDE_ENABLED(trueby default)- Master switch for internal tester override behavior.
ONSET_ADMIN_OVERRIDE_USER_IDS(comma-separated UUIDs)- Users in this list bypass AI cooldown/daily-cap/temporary lock checks.
ONSET_ADMIN_OVERRIDE_EMAILS(comma-separated lowercase emails)- Email-based bypass for internal QA/tester accounts.
Progressive lock behavior:
- Repeated AI rate-limit hits within a short window now trigger a temporary lockout.
- Current default: lock for 15 minutes after 4+ limit hits in 10 minutes.
- Applies to
generate-protocol,daily-insight, andsimulate-protocol-lab.
Operational Cadence¶
- Daily: review dashboard metrics and error logs.
- Weekly: review funnel shifts and alert noise; tune thresholds.
- Per release: run
scripts/release-readiness.shand archive output.