Pixel Pete, the CanaryHub canaryCanaryHub

[ connect ]

Monitor your Supabase backend

Know the moment Supabase slows down or your app loses its database. One prompt adds a Supabase health sub-check to your app. You get up/down alerts by text, error events in your dashboard, and health sub-checks for the stuff your app depends on.

1 · Supabase is your backend, so your app checks it from the inside. Paste this into whatever AI tool builds your app (Lovable, Cursor, Bolt…):

the prompt
Add production monitoring to this app so CanaryHub can watch it:

1. Create a public GET endpoint at /api/health that returns this JSON shape:

   { "status": "ok", "version": "<app version or git sha>", "checks": [{ "name": "database", "status": "ok", "latencyMs": 12 }] }

   Rules: "status" is "ok", "degraded" (something non-critical failing), or "down".
   Add one entry in "checks" for every critical dependency this app has (database,
   payment provider, critical external APIs) with its real measured latencyMs.
   This app uses Supabase, so include a "supabase" entry in "checks": fetch
   <SUPABASE_URL>/rest/v1/ (e.g. https://<project-ref>.supabase.co/rest/v1/) with
   the header "apikey: <the anon key already configured in this app>", measure the
   latency, and report "ok" for any HTTP status below 500.
   The endpoint must respond in under 2 seconds, require no authentication, and
   cause no side effects.

2. Report server-side errors to CanaryHub. Wherever this app catches an unexpected
   server error, send (fire-and-forget — never block or crash the request if this
   fails):

   POST https://ingest.canaryhub.ai/api/v1/events
   Authorization: Bearer ch_live_YOUR_KEY_HERE
   Content-Type: application/json

   { "events": [{ "type": "error", "name": "<short_snake_case_error_name>", "message": "<error message, max 2000 chars>" }] }

3. Deploy, then confirm https://<this app's URL>/api/health returns the JSON from
   step 1 in the browser.

Replace ch_live_YOUR_KEY_HERE with a real key — sign up free and create one under API keys.

2 · Verify it worked

Ask your tool to deploy, then open yourapp.com/api/health in a browser — you should see the JSON from the prompt. Events show up live in your dashboard.

← all platforms