Metrics API with Grafana Cloud
A guide from Supabase
Apps on Plentiful run on Supabase's open-source database, sign-in, file storage and live updates, so most of this guide applies. The differences: your app reaches its database through its own server — not Supabase's data API (supabase.from(…)) — there are no Edge Functions (your app's server does that work), and scheduled work uses Jobs. Where it says "Supabase dashboard", use your app's Dashboard. Ask the builder when in doubt.
Grafana Cloud gives you a fully managed Prometheus endpoint plus hosted Grafana dashboards, which makes it the fastest way to explore the Supabase Metrics API without operating your own infrastructure.
Grafana maintains a Supabase integration guide for Grafana Cloud. It runs on the same Metrics API documented here, but is community-maintained by Grafana, so feature coverage might differ from what Supabase officially supports.
Prerequisites#
- A Supabase project with access to the Metrics API (Secret API key
sb_secret_...). - A Grafana Cloud account with Prometheus metrics enabled (Free or Pro tier).
- A Grafana API token with the
metrics:writeandmetrics:readscopes if you plan to push data manually.
1. Create a Grafana Cloud stack#
- Sign in to Grafana Cloud.
- Create (or select) a stack that has Prometheus Metrics enabled (Free and Pro tiers both work for this guide).
2. Configure the Supabase integration#
- Navigate to Connections → Add new connection → Supabase inside Grafana Cloud.
- Provide:
- Your Supabase project ref (e.g.
abcd1234). - The Metrics API endpoint:
https://<project-ref>.supabase.co/customer/v1/privileged/metrics. - HTTP Basic Auth credentials (
sb_secret_...).
- Your Supabase project ref (e.g.
- Choose the scrape interval (1 minute recommended) and test the connection. Grafana Cloud will deploy an agent in the background that scrapes the Metrics API and forwards the data to Prometheus.
If you prefer to reuse an existing Grafana Agent deployment, configure an integration pipeline with the same URL and credentials.
3. Import the Supabase dashboard#
- Open your Grafana Cloud dashboard list and click New → Import.
- Paste the raw contents of
supabase-grafana/dashboard.json. - When prompted for the datasource, choose the Prometheus instance that receives the Supabase metrics.
This dashboard includes 200+ charts grouped by CPU, IO, connections, replication, WAL, and bloat indicators.
4. Configure alerts (optional)#
The docs/example-alerts.md file contains suggested alert rules (disk saturation, long-running queries, replication lag, etc.). Import the alert rules into Grafana Cloud’s Alerting UI or translate them into Grafana Cloud’s managed alert rule format.
5. Troubleshooting#
- Metrics missing? Ensure the Grafana Cloud agent can reach
https://<project-ref>.supabase.coand that the selected Secret API key is still valid. - 401 errors? Create/rotate a Secret API key in Project Settings → API Keys and update the Grafana Cloud credentials.
- Long scrape durations? Reduce label cardinality in your Grafana queries or lower the time range to focus on recent data.