mirror of
https://github.com/supabase/supabase.git
synced 2026-10-19 16:19:10 +03:00
52 lines
2.0 KiB
Plaintext
52 lines
2.0 KiB
Plaintext
---
|
|
id: 'metrics'
|
|
title: 'Metrics'
|
|
description: 'Observability for your Supabase project'
|
|
---
|
|
|
|
In addition to the reports and charts built in to the Supabase dashboard, each project hosted on the Supabase platform comes with a [Prometheus](https://prometheus.io/)-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.
|
|
|
|
<Admonition type="note">
|
|
|
|
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.
|
|
|
|
</Admonition>
|
|
|
|
<Admonition type="note">
|
|
|
|
The endpoint discussed in this article is not available on self-hosted.
|
|
|
|
</Admonition>
|
|
|
|
## 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.
|
|
|
|
```shell
|
|
> 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:
|
|
|
|
```yaml
|
|
scrape_configs:
|
|
- job_name: "MyJob"
|
|
metrics_path: "/customer/v1/privileged/metrics"
|
|
scheme: https
|
|
basic_auth:
|
|
username: "service_role"
|
|
password: "<your service_role JWT>"
|
|
static_configs:
|
|
- targets: [
|
|
"<your Supabase Project ID>.supabase.co:443"
|
|
]
|
|
labels:
|
|
group: "MyGroupLabel"
|
|
```
|
|
|
|
Additionally, we [maintain a guide](https://github.com/supabase/supabase-grafana) on quickly setting up a scraping agent to work with Grafana Cloud.
|