How to Monitor Your Supabase Backend with Vigilmon
Supabase has rapidly become the go-to open-source Firebase alternative — giving developers a PostgreSQL database, authentication, real-time subscriptions, storage, and Edge Functions in one platform. But "it's managed" doesn't mean "it can't go down." Supabase incidents, Edge Function cold starts, database connection pool exhaustion, and storage endpoint failures all affect your users.
This guide shows you how to monitor your Supabase backend with Vigilmon.
What Can Fail in Supabase
- PostgreSQL database — your primary data store. Down = app broken.
- Auth API — signup and login endpoints. Down = users can't access your app.
- REST API (PostgREST) — the auto-generated REST layer. Down = all data reads/writes fail.
- Edge Functions — serverless functions for custom logic. Cold starts can cause timeouts.
- Storage — file uploads and downloads. Down = broken image/file workflows.
- Realtime — WebSocket connections for live data. Down = stale UI.
Step 1: Monitor Your Supabase REST API
The simplest check — verify PostgREST is responding:
GET https://<your-project>.supabase.co/rest/v1/
This returns table metadata if PostgREST is alive. Add this directly to Vigilmon:
- Log in to vigilmon.online → Add Monitor
- Type: HTTP(S)
- URL:
https://YOUR_PROJECT.supabase.co/rest/v1/ - Headers:
apikey: YOUR_ANON_KEY - Interval: 60 seconds
- Alert if: Status != 200 or response > 3000ms
Note: Vigilmon supports custom HTTP headers for authenticated endpoints.
Step 2: Monitor the Auth Endpoint
GET https://<your-project>.supabase.co/auth/v1/health
This is Supabase's official auth health endpoint. Add it as a second monitor:
- URL:
https://YOUR_PROJECT.supabase.co/auth/v1/health - Headers:
apikey: YOUR_ANON_KEY - Alert if: Status != 200
Step 3: Create a Database Health Edge Function
For deeper PostgreSQL health monitoring, create a Supabase Edge Function:
// supabase/functions/health-db/index.ts
import { serve } from 'https://deno.land/std@0.168.0/http/server.ts';
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2';
const supabase = createClient(
Deno.env.get('SUPABASE_URL')!,
Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!
);
serve(async () => {
try {
// Simple query to verify DB is responding
const { data, error } = await supabase
.from('_health_check')
.select('1')
.limit(1);
if (error) {
// Try a raw query instead
const { data: rawData, error: rawError } = await supabase
.rpc('health_check');
if (rawError) {
return new Response(
JSON.stringify({ status: 'error', message: rawError.message }),
{ status: 503, headers: { 'Content-Type': 'application/json' } }
);
}
}
return new Response(
JSON.stringify({ status: 'ok', db: 'postgresql' }),
{ status: 200, headers: { 'Content-Type': 'application/json' } }
);
} catch (err) {
return new Response(
JSON.stringify({ status: 'error', message: String(err) }),
{ status: 503, headers: { 'Content-Type': 'application/json' } }
);
}
});
Deploy with:
supabase functions deploy health-db
Add to Vigilmon:
- URL:
https://YOUR_PROJECT.supabase.co/functions/v1/health-db - Headers:
Authorization: Bearer YOUR_ANON_KEY
Step 4: Monitor Storage Availability
If your app uses Supabase Storage for user uploads, add a storage health check:
// supabase/functions/health-storage/index.ts
import { serve } from 'https://deno.land/std@0.168.0/http/server.ts';
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2';
const supabase = createClient(
Deno.env.get('SUPABASE_URL')!,
Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!
);
serve(async () => {
try {
// List a bucket to verify storage is up
const { data, error } = await supabase.storage.listBuckets();
if (error) throw new Error(error.message);
return new Response(
JSON.stringify({ status: 'ok', buckets: data.length }),
{ status: 200, headers: { 'Content-Type': 'application/json' } }
);
} catch (err) {
return new Response(
JSON.stringify({ status: 'error', message: String(err) }),
{ status: 503, headers: { 'Content-Type': 'application/json' } }
);
}
});
Supabase Monitoring Coverage Table
| Monitor | URL | Alerts On |
|---|---|---|
| REST API | *.supabase.co/rest/v1/ |
PostgREST down |
| Auth API | *.supabase.co/auth/v1/health |
Auth service down |
| Database | Edge Function /health-db
|
Postgres unreachable |
| Storage | Edge Function /health-storage
|
Storage service down |
| SSL | *.supabase.co |
Cert expiry < 14 days |
Common Supabase Failure Patterns
Connection pool exhaustion: Supabase's default connection pooler (PgBouncer) has limits. A spike in concurrent requests exhausted the pool; new connections returned 503. Edge Function health check caught it within 60 seconds.
Edge Function cold start timeout: An Edge Function wasn't called for several hours. On the next call, a Deno cold start took 8 seconds — triggering a Vigilmon response-time alert.
Database storage quota: The free tier's 500MB database limit was hit. Writes began failing. Auth (which writes sessions) broke first; auth health monitor alerted before users noticed login failures.
Conclusion
Supabase is excellent infrastructure — but monitoring can't be optional. With Vigilmon covering your REST API, auth endpoint, database health, and storage availability, you get real-time visibility into every layer of your Supabase backend.
Start monitoring your Supabase backend free at vigilmon.online
Top comments (0)