Send Supabase metrics to Axiom
This page explains how to send Supabase project metrics to Axiom using the OpenTelemetry Collector.
Every Supabase project exposes a Prometheus-compatible Metrics API with Postgres performance and health metrics, such as CPU, memory, disk, connections, and query throughput. To send these metrics to Axiom, run an OpenTelemetry Collector that scrapes the Metrics API and forwards the metrics to Axiom over OTLP/HTTP.
This page covers metrics. To send Supabase logs to Axiom, see Connect Axiom with Supabase.
Prerequisites
- Create an Axiom account.
- Create a dataset in Axiom where you send your data.
- Create an API token in Axiom with permissions to ingest data to the dataset you have created.
- Create a Supabase project.
- Install the contrib distribution of the OpenTelemetry Collector (
otelcol-contrib). The Prometheus receiver isn’t included in the core distribution.
Get Supabase credentials
The Metrics API is available at https://PROJECT_REF.supabase.co/customer/v1/privileged/metrics and uses HTTP basic authentication. The username is service_role and the password is a secret API key of your project.
-
In Supabase, find your project reference. It’s the subdomain of your project URL, and it’s also displayed in the dashboard.
-
Go to Project Settings > API Keys, and then create or copy a secret API key. Secret API keys start with
sb_secret_. Recommended: Create a dedicated secret API key for metrics collection so that you can rotate it independently. -
Optional: Check that the endpoint returns metrics:
shell
Replace PROJECT_REF with your Supabase project reference and SUPABASE_SECRET_KEY with your secret API key.
For more information, see Metrics API and API keys in the Supabase documentation.
Configure the OpenTelemetry Collector
Create a file named config.yaml with a Prometheus receiver that scrapes the Supabase Metrics API, and an OTLP/HTTP exporter that sends the metrics to Axiom:
The OTLP/HTTP exporter appends /v1/metrics to the endpoint and sends Protobuf-encoded data. In OpenTelemetry Collector v0.144.0 and later, the exporter is called otlp_http. The otlphttp name still works as a deprecated alias.
Start the Collector with your secret API key in the SUPABASE_SECRET_KEY environment variable:
To monitor several Supabase projects, add one entry to targets for each project, or one scrape job for each project if their secret API keys differ.
Query Supabase metrics
After about a minute, metrics appear in your dataset. The Collector keeps the original Prometheus metric names, such as node_cpu_seconds_total and pg_database_size_mb. It sets the service.name tag to the scrape job name (supabase) and service.instance.id to the scrape target. Supabase metrics also carry tags such as supabase_project_ref.
Counters, such as metrics ending in _total, are cumulative. Use prom::rate to turn them into per-second rates.
The queries below make a starter dashboard. Add each one as a chart to a new dashboard and replace DATASET_NAME with the name of your metrics dataset. For more information about the query language, see Introduction to MPL.

CPU usage
Calculate the fraction of CPU time spent outside the idle mode:
Available memory
Calculate the fraction of memory available to applications:
Free disk space
Calculate the fraction of free space on the data disk:
Database size
Chart the database size in megabytes:
Connections
Chart the number of Postgres backends:
Chart active client connections to the project’s dedicated PgBouncer connection pooler by database:
Chart clients waiting for a server connection in PgBouncer. A value that stays above zero means the pool is saturated:
Transactions
Chart committed and rolled-back transactions per second:
Supabase refreshes Postgres statistics counters, such as the transaction counters, about every two minutes. If a rate chart alternates between zero and higher values over a short time range, replace $__interval with 2m or a longer window.
To translate other panels from the Supabase Grafana dashboard or the example alert rules, see Migrate PromQL queries to Axiom.
What’s next
- Set up threshold monitors on metrics such as free disk space or CPU usage to get alerted before your project runs out of resources.
- Send Supabase logs to Axiom to investigate the events behind a change in a metric.
- For more information about metrics in Axiom, see Metrics.