Supabase monitoring
Supabase gives you usage reports, logs and a Prometheus metrics endpoint but no alert when your project stops answering, so deploy an edge function that runs select 1 against Postgres, returns 503 when it fails, and point an outside monitor at it.
Supabase is good at telling you how your project behaved. The dashboard has usage reports, logs for Postgres, the API, Auth and edge functions, and the Metrics API exposes about 200 Postgres series in Prometheus format. What it does not do is message you when your project stops answering. status.supabase.com covers platform incidents, not your project, and a project can be down while that page is all green.
Supabase project paused
The outage most free projects actually have is a pause. Supabase pauses a free project that has too little database activity over 7 days, and sends a warning email first. A paused project takes Postgres, the API, Auth, Storage and every edge function offline until someone clicks Resume in the dashboard. Supabase says a few user requests to the database each day is typically enough to stay active, so a health check that queries Postgres every 5 minutes, 288 times a day, should also keep the project counted as active. Supabase decides what counts and can change it. The guaranteed fix is a paid plan, from $25 a month, where projects never pause.
Supabase database monitoring
For the inside view, every hosted project exposes a Prometheus-compatible endpoint at https://<project-ref>.supabase.co/customer/v1/privileged/metrics, read with HTTP Basic auth: username service_role, password a secret API key. It is in beta, and the Grafana Cloud integration in the dashboard scrapes it in one click. That gives you connections, CPU, memory and disk to alert on. It still cannot tell you the API answers a real request, because the metrics come from the database side.
The edge function health check
import { Pool } from 'jsr:@db/postgres@^0';
// SUPABASE_DB_URL is set for every deployed function.
const pool = new Pool(Deno.env.get('SUPABASE_DB_URL')!, 1);
const headers = { 'cache-control': 'no-store' };
export default {
fetch: async () => {
try {
const connection = await pool.connect();
try {
await connection.queryArray`select 1`;
} finally {
connection.release();
}
return Response.json({ ok: true }, { headers });
} catch {
// 503 so a dead database reads as down, not as a crashed check
return Response.json({ ok: false }, { status: 503, headers });
}
},
};supabase functions new health
# paste the code above into supabase/functions/health/index.ts
supabase functions deploy health --no-verify-jwt
curl -i https://<project-ref>.supabase.co/functions/v1/health Edge functions require a JWT by default, and an uptime monitor does not send one, so deploy this one with --no-verify-jwt. The body is a single boolean, so there is nothing to leak. On the free plan it costs about 8,640 of your 500,000 monthly invocations at a 5-minute interval. A slow cold start is fine, the monitor waits up to 10 seconds before it calls the check failed.
Supabase uptime in three steps
- Add the function URL Create a service in Logdash and paste https://<project-ref>.supabase.co/functions/v1/health. It checks every 5 minutes on the free plan, every minute on Builder at $9 a month and every 15 seconds on Pro at $15.
- Connect Telegram Add a Telegram channel once and attach it to the monitor. Any status outside 200-399, or no answer within 10 seconds, counts as down, so a hung connection pool alerts too.
- Break the database Point the function at a wrong database URL in a test project, or pause the project from the dashboard. The next check fails and a Telegram alert lands with the monitor name, the status code and the error.
Logdash vs Supabase built-in monitoring
| Feature | Logdash | Supabase |
|---|---|---|
| Alert when your project stops answering | Telegram or webhook on the first failed check | None for your project |
| Database metrics | Status code and response time of the check | Dashboard reports and about 200 Postgres series |
| Logs | From your own app, via eight SDKs | Postgres, API, Auth and edge function logs built in |
| Warning before a free project pauses | None, you hear when the check fails | Email before the pause |
| Cost | Free for 5 services | Included |
When Supabase built-in tools is the better pick
- You need to know why the database is slow, not whether it answers. Send the Metrics API to Grafana Cloud, one click from the dashboard, for connections, cache hit rate and disk.
- You want stack traces from edge function exceptions. Supabase logs plus an error tracker like Sentry fit that better than an uptime check.