Built this for my own Supabase + Next.js stack — pg_stat_statements shows you the slow queries but doesn't tell you which deploy caused them. Lantern does it for Rails; this is the same idea for the rest of us.
How it works on Supabase specifically:
pg_stat_statements (one toggle).CREATE ROLE pgblame_reader WITH LOGIN PASSWORD '…'; GRANT pg_monitor TO pgblame_reader;. (On Supabase pg_stat_statements lives in the extensions schema, and pg_monitor is the grant that works — pg_read_all_stats isn't grantable there.)Free tier covers 1 project + 7 days of history; $19/mo for 5 projects, 30 days, and email/Slack alerts on regressions.
Source for the agent + the literal SQL it runs: https://github.com/liberzon/pgblame-agent We never see your application data — only aggregate stats from pg_stat_statements.
The user introduces 'pgblame', an open-source tool designed to link Postgres query regressions to Vercel deploys, specifically for a Supabase + Next.js stack. The tool utilizes pg_stat_statements and requires setting up a Docker container and Vercel webhooks. It offers a free tier for one project and a paid tier for more features.
Happy to answer Supabase-specific questions. We tested against the direct connection (port 5432); the transaction-mode pooler (6543) doesn't keep session state for the agent's session_timeout setting.