Supabase PostgreSQL Monitoring
Supabase gives you a full Postgres database with auth, storage, and APIs on top. Underneath it all is real PostgreSQL — which means when queries slow down, you debug it like PostgreSQL. MonPG takes your Supabase monitoring from dashboard summaries to query-level performance evidence.
Why Supabase Projects Need Deeper Monitoring
The Supabase dashboard reports database size, request counts, and basic resource usage. That tells you when the project is under pressure but not why. A PostgREST endpoint that suddenly takes 2 seconds is usually one Postgres query with a bad plan — and finding it requires pg_stat_statements history, not request logs.
MonPG connects to your Supabase project over a standard Postgres connection string. The collector runs in your own environment — a container, VM, or Kubernetes pod — and reads pg_stat_statements, pg_stat_activity, and the other system views Supabase exposes. No Supabase service keys needed, just a read-only database role.
What MonPG Adds to Supabase Monitoring
- Query performance history: Every query digest tracked over time — execution time, rows, block I/O, temp spills. When a deploy regresses an endpoint, the diff against yesterday's workload is already there.
- Index advisor: Row Level Security policies and PostgREST filters generate query shapes that are easy to miss indexes for. MonPG analyzes the actual workload and recommends specific indexes with estimated impact before you create anything.
- Connection and pooler visibility: Supabase routes most traffic through its connection pooler. MonPG tracks direct and pooled connections by application, state, and duration — so you see pool saturation and idle-in-transaction sessions before they exhaust the compute's connection limit.
- Lock analysis: Real-time blocking chains with the queries involved. RLS-heavy workloads with long-running transactions are a classic source of silent lock queues.
- Vacuum and bloat tracking: Dead tuple accumulation per table, autovacuum history, and XID age — the maintenance debt the dashboard doesn't surface.
- Regression alerts: Alert on query latency regressions, connection pressure, and replication lag instead of waiting for users to report slow pages.
Supabase-Specific Configuration
Supabase projects expose both a direct connection and a pooled connection. For monitoring, the direct connection matters:
- Direct connection: Use the direct connection string from Project Settings → Database. System views like pg_stat_statements are only meaningful on a session-level connection, so point the collector here, with
sslmode=require. - Pooled traffic stays visible: Your application can keep using the transaction-mode pooler — MonPG observes its sessions through pg_stat_activity from the direct connection.
- Read-only role: Create a dedicated monitoring role with pg_monitor instead of using the postgres superuser; MonPG never needs write access.
# Connect to Supabase PostgreSQL (direct connection)
docker run -d monpg/collector \
-e MONPG_API_KEY=mpg_k1_... \
-e PG_HOST=db.xxxxxxxxxxxx.supabase.co \
-e PG_PORT=5432 \
-e PG_USER=monpg_monitor \
-e PG_SSLMODE=require \
-e PG_DATABASE=postgresOne Dashboard Across Your Postgres Fleet
Teams rarely run Supabase alone — there is usually an RDS instance, a Neon branch, or a self-hosted Postgres next to it. MonPG monitors them all — plus MySQL, MariaDB, and SQL Server — from a single dashboard.
Operational Risk Checks for Supabase PostgreSQL
MonPG runs 50+ operational checks against your Supabase database: configuration drift, security posture (SSL settings, role permissions), performance risk (missing indexes, table bloat, unused indexes), and operational state (replication status, connection utilization against your compute size).
Each check includes severity, a detailed explanation, and actionable remediation steps. Learn more about MonPG's approach to PostgreSQL monitoring.
Related Resources
- PostgreSQL Index Optimization — Index strategies for PostgREST and RLS query patterns.
- Connection Pooling Guide — How transaction-mode pooling changes what your app can and cannot do.
- Slow Query Optimization — Finding and fixing the query behind a slow endpoint.
- PostgreSQL Query Monitoring — Query trends, regressions, and pg_stat_statements visibility for managed PostgreSQL.
Monitor your Supabase Postgres in 5 minutes
Free trial — connect with your project's direct connection string.
Start trial