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

supabase/functions/health/index.ts
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

  1. 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.
  2. 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.
  3. 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

FeatureLogdashSupabase
Alert when your project stops answeringTelegram or webhook on the first failed checkNone for your project
Database metricsStatus code and response time of the checkDashboard reports and about 200 Postgres series
LogsFrom your own app, via eight SDKsPostgres, API, Auth and edge function logs built in
Warning before a free project pausesNone, you hear when the check failsEmail before the pause
CostFree for 5 servicesIncluded

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.
Why was my Supabase project paused?
Free projects with too little database activity over 7 days are paused, after a warning email. Click Resume in the dashboard to bring it back. Paid plans are never paused, and a health check that queries Postgres every few minutes should keep a free project active.
How do I monitor Supabase uptime?
Deploy a health edge function that runs select 1 and returns 503 on failure, deploy it with --no-verify-jwt, and point an outside HTTP monitor at its URL. It catches a dead database, a paused project and a broken edge runtime with one check.
What is the best tool for Supabase database monitoring?
For metrics, the Supabase Metrics API scraped by Grafana Cloud or any Prometheus-compatible tool. For knowing the database answers at all, an outside check on a health function. They answer different questions, and most projects want both.
What should I use for Supabase error monitoring?
An error tracker such as Sentry, alongside the edge function logs in the dashboard. An uptime check tells you the project is down, not which line threw. Logdash does the first job, not the second.

Point it at your own URL and watch it for real.