The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Update metrics documentation (#33893)
Chris Gwilliamsd55f6fb78096
diff --git a/apps/docs/content/guides/telemetry/metrics.mdx b/apps/docs/content/guides/telemetry/metrics.mdxindex ced0f742077..0309a85ab88 100644--- a/apps/docs/content/guides/telemetry/metrics.mdx+++ b/apps/docs/content/guides/telemetry/metrics.mdx@@ -4,7 +4,7 @@ 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.+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, updated every minute, 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.@@ -28,13 +28,40 @@ Your project's metrics endpoint is accessible at `https://<project-ref>.supabase> curl https://<project-ref>.supabase.co/customer/v1/privileged/metrics --user 'service_role:<service-role-jwt>'```-## Configuring Prometheus+## Supabase Grafana-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:+The pre-configured Supabase Grafana Dashboard is an advanced version of the [Dashboard's Database Reports](https://supabase.com/dashboard/project/_/reports/database). It visualizes over 200 database performance and health metrics.++++Instructions are included in the README for deploying the repository using docker.++## Using the metrics endpoint in production++To set up monitoring for your project, you will need two things:++1. A datastore - a place to store the metrics coming from your Supabase project over time+2. A dashboard - a place to visualize the state of your Supabase project for a defined period++### Setting up a metrics datastore++One of the more well-known options is [Prometheus](https://prometheus.io/docs/introduction/overview/) and it is the tool used in this guide.++You can [self-host](https://prometheus.io/docs/prometheus/latest/installation/) Prometheus or choose a managed service to store your metrics. Some of the providers offering managed Prometheus are:++- [Digital Ocean](https://marketplace.digitalocean.com/apps/prometheus)+- [AWS](https://aws.amazon.com/prometheus/)+- [Grafana Cloud](https://grafana.com/products/cloud/metrics/)++Follow the guides for the deployment option you choose++#### Adding a scrape job to Prometheus++For Prometheus, modify your `prometheus.yaml` file to add a Supabase job, and set the `metrics_path`, `scheme`, `basic_auth` and `targets` parameters. For example:```yamlscrape_configs:- - job_name: "MyJob"+ - job_name: "MySupabaseJob"metrics_path: "/customer/v1/privileged/metrics"scheme: httpsbasic_auth:@@ -48,198 +75,41 @@ scrape_configs:group: "MyGroupLabel"```-Additionally, we [maintain a repo](https://github.com/supabase/supabase-grafana) for a scraping agent to work with Grafana Cloud.--## Deploying Supabase Grafana--The pre-configured Supabase Grafana Dashboard is an advanced version of the [Dashboard's Database Reports](https://supabase.com/dashboard/project/_/reports/database). It visualizes over 200 database performance and health metrics and is updated every minute.----### Deploying locally--<Admonition type="note">- This method uses docker to deploy locally but the same steps can be used to deploy to a dedicated- server, such as [Fly](https://fly.io), [Railway](https://railway.app) or [Digital- Ocean](https://digitalocean.com)-</Admonition>--Prerequisites:--- Must have [Docker](https://www.docker.com/products/docker-desktop/) or a Docker compatible runtime on your machine--<Admonition type="note">--Supabase Grafana only tracks metrics while it's active. For monitoring historical trends, it's better to use a dedicated server that can record data continuously.--</Admonition>--<StepHikeCompact>-- <StepHikeCompact.Step step={1} >+### Setting up a dashboard- <StepHikeCompact.Details title="Download the project">- Download the code from the [GitHub repo](https://github.com/supabase/supabase-grafana/tree/main)+For this guide, we will be using [Grafana](https://grafana.com/docs/grafana/latest/introduction/).+You can [self-host](https://grafana.com/docs/grafana/latest/setup-grafana/installation/) Grafana or many providers offer managed Grafana, some of which are listed below:- </StepHikeCompact.Details>- <StepHikeCompact.Code>- ```sh- git clone https://github.com/supabase/supabase-grafana.git- ```- </StepHikeCompact.Code>+- [DigitalOcean](https://marketplace.digitalocean.com/apps/grafana)+- [AWS](https://aws.amazon.com/grafana/)+- [Grafana Cloud](https://grafana.com/grafana/)- </StepHikeCompact.Step>+Follow the guides of the provider you choose to get Grafana up and running.- <StepHikeCompact.Step step={2} >+### Adding a data source to Grafana- <StepHikeCompact.Details title="Create a .env file">- copy the `example.env` into a new `.env`+In the left-hand menu, select `Data sources` and click `Add new data source`.- </StepHikeCompact.Details>- <StepHikeCompact.Code>- ```sh- cp .env.example .env- ```- </StepHikeCompact.Code>+Select `Prometheus` and enter the connection details for the Prometheus instance you have set up.- </StepHikeCompact.Step>+Under **Interval behavior**, set the **scraping interval** to 60s and test the data source. Once it has passed, save it.- <StepHikeCompact.Step step={3}>+### Adding the Supabase dashboard- <StepHikeCompact.Details title="Add your credentials">- - To monitor a single project, add your service_role key from the [API Settings](https://supabase.com/dashboard/project/_/settings/api) and Project ID from the [General Settings](https://supabase.com/dashboard/project/_/settings/general).- - To monitor multiple projects, create an [account access token](https://supabase.com/dashboard/account/tokens) and add it to your `.env` file.+In the left-hand menu, select `Dashboards` and click `New`. From the drop-down, select `Import`.- </StepHikeCompact.Details>+Copy the raw file from our [supabase-grafana](https://raw.githubusercontent.com/supabase/supabase-grafana/refs/heads/main/grafana/dashboard.json) repository and paste it (or upload the file).- <StepHikeCompact.Code>- <Tabs- scrollable- size="small"- type="underlined"- defaultActiveId="single-project"- >- <TabPanel id="single-project" label="Monitor a single project">+Click `Load` and the dashboard will load from the project specified in your Prometheus job.+### Monitoring your project- - Add the values to your `.env` file:- ```text .env- SUPABASE_PROJECT_REF="your_project_reference"- SUPABASE_SERVICE_ROLE_KEY="your_service_role"- ```- </TabPanel>- <TabPanel id="monitor-an-org" label="monitor multiple projects">+You can configure alerts from Prometheus or Grafana. The `supabase-grafana` repository has a selection of [example alerts](https://github.com/supabase/supabase-grafana/blob/main/docs/example-alerts.md) that can be configured.-- ```text .env- SUPABASE_ACCESS_TOKEN="your_access_token"- ```- </TabPanel>- </Tabs>- </StepHikeCompact.Code>-- </StepHikeCompact.Step>- <StepHikeCompact.Step step={4}>- <StepHikeCompact.Details title="Add a password to your .env">- <Admonition type="note" label="password manager">- For security, consider using a [password generator](https://bitwarden.com/password-generator/)- </Admonition>-- </StepHikeCompact.Details>- <StepHikeCompact.Code>- ```text .env- GRAFANA_PASSWORD="your password"- ```- </StepHikeCompact.Code>- </StepHikeCompact.Step>-- <StepHikeCompact.Step step={5}>- <StepHikeCompact.Details title="Deploy Grafana with Docker">--- Deploy the server. Once it is active, you can go to <a href='http://localhost:8000/login'>localhost:8000/login</a> in the browser-- </StepHikeCompact.Details>- <StepHikeCompact.Code>- ```text- docker compose up- ```- </StepHikeCompact.Code>-- </StepHikeCompact.Step>-- <StepHikeCompact.Step step={6}>- <StepHikeCompact.Details title="Login" >- Login with your username (default is `admin`) and the password you created in step 4.- </StepHikeCompact.Details>- <StepHikeCompact.Code>- - </StepHikeCompact.Code>- </StepHikeCompact.Step>--</StepHikeCompact>--### Deploying to Grafana cloud--<Admonition type="note">- This section describes the Grafana cloud Supabase template, which is created and maintained by- Grafana.+<Admonition type="caution">+ Grafana Cloud has an unofficial integration for scraping Supabase metrics. See their+ [docs](https://grafana.com/docs/grafana-cloud/monitor-infrastructure/integrations/integration-reference/integration-supabase/)+ for instructions on how to configure it but note that it is not full-featured nor is it supported+ by Supabase.</Admonition>--<StepHikeCompact>-- <StepHikeCompact.Step step={1}>-- <StepHikeCompact.Details title="Create a free Grafana Cloud account" >- Go to Grafana\'s [registration form](https://grafana.com/auth/sign-up/create-user?pg=login) and create an account- </StepHikeCompact.Details>- <StepHikeCompact.Code>- - </StepHikeCompact.Code>- </StepHikeCompact.Step>--- <StepHikeCompact.Step step={2} >-- <StepHikeCompact.Details title="Give a name to your Grafana project">- Grafana will prompt you to create a stack. Give it a name and continue.- </StepHikeCompact.Details>- <StepHikeCompact.Code>- - </StepHikeCompact.Code>-- </StepHikeCompact.Step>-- <StepHikeCompact.Step step={3} >-- <StepHikeCompact.Details title="Create a new Grafana Dashboard">- Create a new Dashboard- </StepHikeCompact.Details>- <StepHikeCompact.Code>- - </StepHikeCompact.Code>--- </StepHikeCompact.Step>- <StepHikeCompact.Step step={4} >- <StepHikeCompact.Details title="Search for the Supabase template" />-- <StepHikeCompact.Code>- - </StepHikeCompact.Code>--- </StepHikeCompact.Step>-- <StepHikeCompact.Step step={5} >- <StepHikeCompact.Details title="Add your credentials and deploy">- Add your service_role key from the [API Settings](https://supabase.com/dashboard/project/_/settings/api) and Project ID from the [General Settings](https://supabase.com/dashboard/project/_/settings/general) to your Grafana credentials. Then install your dashboard.- </StepHikeCompact.Details>- <StepHikeCompact.Code>- - </StepHikeCompact.Code>-- </StepHikeCompact.Step>--</StepHikeCompact>diff --git a/supa-mdx-lint/Rule003Spelling.toml b/supa-mdx-lint/Rule003Spelling.tomlindex 671d1f4461b..eb261d1af02 100644--- a/supa-mdx-lint/Rule003Spelling.toml+++ b/supa-mdx-lint/Rule003Spelling.toml@@ -309,6 +309,7 @@ allow_list = ["supabase-community","supabase-flutter","supabase-gdscript",+ "supabase-grafana","supabase-go","supabase-js","supabase-kt",