From b91eaef3bcd58c6c60aedca3d798d5a418ad01cc Mon Sep 17 00:00:00 2001 From: Div Arora Date: Wed, 27 Apr 2022 14:00:56 +0800 Subject: [PATCH] chore: details on using the project metrics endpoint --- web/docs/guides/platform/metrics.mdx | 31 ++++++++++++++++++++++++++++ web/sidebars.js | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 web/docs/guides/platform/metrics.mdx diff --git a/web/docs/guides/platform/metrics.mdx b/web/docs/guides/platform/metrics.mdx new file mode 100644 index 00000000000..1340927c3a7 --- /dev/null +++ b/web/docs/guides/platform/metrics.mdx @@ -0,0 +1,31 @@ +--- +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. + +:::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. + +::: + +:::note + +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://.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://.supabase.co/customer/v1/privileged/metrics --user 'service_role:' +``` + +Additionally, we [maintain a guide](https://github.com/supabase/grafana-agent-fly-example/) on quickly setting up a scraping agent to work with Grafana Cloud. diff --git a/web/sidebars.js b/web/sidebars.js index c14a1942c7d..94d4d8acc68 100755 --- a/web/sidebars.js +++ b/web/sidebars.js @@ -183,7 +183,7 @@ module.exports = { type: 'category', label: 'Platform', collapsed: false, - items: ['guides/platform/logs', 'going-into-prod'], + items: ['guides/platform/logs', 'going-into-prod', 'guides/platform/metrics'], }, { type: 'category',