Cron

Alert when database errors spike (hourly)

Counts Postgres ERROR/FATAL/PANIC log lines over the last hour through the Supabase Management API logs endpoint. When the count passes DB_ERROR_SPIKE_THRESHOLD_PER_HOUR (default 5,000) it raises one in-portal notification and one owner email, at most once per 6 hours. per_hour is the error count; current_count, previous_count and delta are always null. ok is false when the error count cannot be read (read_failed, never treated as 0), the readings call fails, or the dedup stamp fails. notification.queued only says the fire-and-forget hand-off did not throw. The 6-hour dedup stamp is written only after the owner email is sent: a failed email is reported, leaves marked null so the next hourly run retries, and never fails the call. Protected by CRON_SECRET via the x-cron-secret header. Scheduled hourly by the db-error-spike stage of the hourly-sweeps schedule in .slipstream.json.

post/cron/db-error-spike

Request

  • Base URL: https://api.apphandoff.com/api
  • URL: https://api.apphandoff.com/api/cron/db-error-spike
  • Auth: none required

Response

Check result

okboolean required
outcome'below_threshold' | 'deduped' | 'alert' | 'read_failed' required
current_countunknown
previous_countunknown
deltaunknown
per_hourinteger nullable
threshold_per_hournumber
markedboolean nullable

Changes

No recorded changes to this operation across all 1 revision of this API.