Metrics
In addition to the reports and charts built in to the Supabase dashboard, each project hosted on the Supabase platform comes with a Prometheus-compatible metrics endpoint, which can be used to gather insight into the health and status of your project.
You can use this endpoint to ingest data into your own monitoring and alerting infrastructure, as long as it is capable of scraping Prometheus-compatible endpoints, in order to set up custom rules beyond those supported by the Supabase dashboard.
The endpoint discussed in this article is in beta, and the metrics returned by it might evolve or be changed in the future to increase its utility.
The endpoint discussed in this article is not available on self-hosted.
Accessing the metrics endpoint
Your project's metrics endpoint is accessible at https://<project-ref>.supabase.co/customer/v1/privileged/metrics
. Access to the endpoint is secured via HTTP Basic Auth; the username is service_role
, while the password is the service role JWT available through the Supabase dashboard.
_10> curl https://<project-ref>.supabase.co/customer/v1/privileged/metrics --user 'service_role:<service-role-jwt>'
Configuring Prometheus
For self-hosted prometheus, modify your prometheus.yaml
file to add a Supabase job, and set the metrics_path
, scheme
, basic_auth
and targets
parameters. For example:
_13scrape_configs:_13 - job_name: "MyJob"_13 metrics_path: "/customer/v1/privileged/metrics"_13 scheme: https_13 basic_auth:_13 username: "service_role"_13 password: "<your service_role JWT>"_13 static_configs:_13 - targets: [_13 "<your Supabase Project ID>.supabase.co:443"_13 ]_13 labels:_13 group: "MyGroupLabel"
Additionally, we maintain a guide on quickly setting up a scraping agent to work with Grafana Cloud.