apps/docs/content/guides/telemetry/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.
<$Partial path="metrics_access.mdx" />
<Admonition type="note">Grafana also documents a Supabase integration reference. While it targets Grafana Cloud, the scrape and agent settings apply equally to self-hosted clusters and offer a community-maintained companion to this guide.
</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: service_role
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.
docs/example-alerts.md into Prometheus or Grafana Alerting.