apps/docs/content/guides/monitoring-and-debugging/metrics/grafana-self-hosted.mdx
Self-hosting Prometheus and Grafana gives you full control over retention, alert routing, and dashboards. The Supabase Metrics API slots into any standard Prometheus scrape job, so you can run everything locally, on a VM, or inside Kubernetes.
<Admonition type="caution">Use this guide only if you need full manual control (custom scrape topology, self-hosted Prometheus or non-standard auth).
Otherwise, use the Grafana Cloud integration available in the Supabase Dashboard.
</Admonition>https://<project-ref>.supabase.co/customer/v1/privileged/metrics every minute using HTTP Basic Auth.Install Prometheus using your preferred method (Docker, Helm, binaries). Then add a Supabase-specific job to prometheus.yml:
scrape_configs:
- job_name: 'supabase'
scrape_interval: 60s
metrics_path: /customer/v1/privileged/metrics
scheme: https
basic_auth:
username: username
password: '<secret API key (sb_secret_...)>'
static_configs:
- targets:
- '<project-ref>.supabase.co:443'
labels:
project: '<project-ref>'
*.supabase.co.Install Grafana (Docker image, Helm chart, or packages) and connect it to Prometheus:
http://prometheus:9090), and click Save & test.supabase-grafana/dashboard.json.You now have over 200 production-ready panels covering CPU, IO, WAL, replication, index bloat, and query throughput.
<Image src="/docs/img/guides/platform/supabase-grafana-prometheus.png" alt="Supabase Grafana dashboard showcasing database metrics" width="3000" height="1509" />
docs/example-alerts.md into Prometheus or Grafana Alerting.