Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@
/packages/sql_input @elastic/obs-infraobs-integrations
/packages/sql_server_input_otel @elastic/ecosystem
/packages/squid @elastic/integration-experience
/packages/supabase @elastic/obs-infraobs-integrations
/packages/stan @elastic/obs-infraobs-integrations
/packages/statsd_input @elastic/obs-infraobs-integrations
/packages/statsd_input_otel @elastic/ecosystem
Expand Down
77 changes: 77 additions & 0 deletions packages/supabase/_dev/build/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Supabase OpenTelemetry Integration

Collect metrics from [Supabase](https://supabase.com) using the OpenTelemetry Prometheus receiver.

## Overview

This integration scrapes metrics from the Supabase Metrics API (Prometheus-compatible) using the OTel Collector's Prometheus receiver. All metrics are collected into a single data stream

- **Metrics** (`supabase.metrics.otel`) — Infrastructure (CPU, memory, load, disk I/O, filesystem, network), PostgreSQL (size, connections, transactions, cache, WAL, replication, bgwriter, statements), Supavisor, PostgREST, Auth, Realtime, and Storage

Metrics are stored with native OTel schema — no field renaming or custom mapping is applied. Raw Prometheus metric names are preserved under the `metrics.*` namespace.

## Compatibility

This integration requires a Supabase **Pro**, **Team**, or **Enterprise** plan. The Metrics API is not available on the Free tier.

## Prerequisites

| Requirement | Details |
|---|---|
| **Supabase plan** | Pro, Team, or Enterprise |
| **Elastic Stack** | 9.4.0+ |
| **Input package** | `prometheus_input_otel` (installed automatically as a dependency) |
| **Content package** | `supabase_otel` (installed automatically as a dependency) |

## Setup

1. **Get your Supabase credentials**:
- Go to your Supabase dashboard → **Settings** → **API**
- Copy the **Project URL** (e.g., `abcdefghijkl.supabase.co`)
- Copy the **service_role** key (under "Project API keys")

2. **Add the integration in Kibana**:
- Go to **Management** → **Integrations** → search for "Supabase"
- Click **Add Supabase**
- Fill in:
- **Targets**: `<your-project-ref>.supabase.co:443`
- **Username**: `service_role`
- **Service Role Key**: paste your service_role JWT

3. **Verify data**:
- Go to **Discover** and filter on `data_stream.dataset: "supabase.metrics.otel"`

## Dashboards

Kibana dashboards are provided by the **Supabase Dashboards** (`supabase_otel`) content package, which is installed automatically. The following dashboards are included:

- **Node & Infrastructure** — CPU, memory, load, disk I/O, filesystem, network
- **Database & Postgres Health** — connections, transactions, cache hit ratio, WAL, replication, bgwriter
- **Services & API Health** — Supavisor, PostgREST, GoTrue Auth, Realtime, Storage

## Metrics Reference

Metrics are scraped from the Supabase Metrics API endpoint:

```
GET https://<project-ref>.supabase.co/customer/v1/privileged/metrics
```

Authentication uses HTTP Basic Auth with `service_role` as the username and the service_role JWT as the password.

See the [Supabase Metrics documentation](https://supabase.com/docs/guides/telemetry/metrics) for full details on available metrics.

### Metric Categories

| Category | Prefix | Examples |
|---|---|---|
| Node / Infrastructure | `node_*` | `node_cpu_seconds_total`, `node_memory_MemAvailable_bytes`, `node_load5`, `node_disk_read_bytes_total` |
| PostgreSQL | `pg_*` | `pg_stat_database_xact_commit_total`, `pg_database_size_mb`, `pg_stat_bgwriter_buffers_alloc_total` |
| Supavisor | `supavisor_*` | `supavisor_connections_active`, `supavisor_pool_connections_idle`, `supavisor_client_queries_count_total` |
| PostgREST | `pgrst_*` | `pgrst_db_pool_available`, `pgrst_db_pool_timeouts_total`, `pgrst_schema_cache_query_time_seconds` |
| Auth (GoTrue) | `gotrue_*` | `gotrue_running`, `gotrue_compare_hash_and_password_completed_total` |
| Realtime | `realtime_*` | `realtime_postgres_changes_client_subscriptions` |
| Go Runtime | `go_*`, `process_*` | `go_goroutines`, `process_cpu_seconds_total`, `process_resident_memory_bytes` |
| HTTP | `http_*` | `http_server_request_duration_seconds_total`, `http_status_codes_total` |

All metrics are stored under the `metrics.*` field namespace with their original Prometheus names (e.g., `metrics.node_load5`, `metrics.pg_stat_database_xact_commit_total`).

Check warning on line 77 in packages/supabase/_dev/build/docs/README.md

View workflow job for this annotation

GitHub Actions / Lint user-facing content

Elastic.Latinisms: Latin terms and abbreviations are a common source of confusion. Use 'for example' instead of 'e.g'.
6 changes: 6 additions & 0 deletions packages/supabase/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# newer versions go on top

Check notice on line 1 in packages/supabase/changelog.yml

View workflow job for this annotation

GitHub Actions / Lint user-facing content

Elastic.Versions: Use 'later versions' instead of 'newer versions' when referring to versions.
- version: "0.1.0"
changes:
- description: Initial release of the Supabase OTel integration for metrics collection via Prometheus receiver.
type: enhancement
link: https://github.com/elastic/integrations/pull/20130
16 changes: 16 additions & 0 deletions packages/supabase/data_stream/metrics/fields/base-fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- name: data_stream.type
type: constant_keyword
description: Data stream type.
- name: data_stream.dataset
type: constant_keyword
description: Data stream dataset.
- name: data_stream.namespace
type: constant_keyword
description: Data stream namespace.
- name: '@timestamp'
type: date
description: Event timestamp.
- name: scope.attributes.service_type #Adding this to satisfy the validator as elastic package validator needs atleast one dimension field by default.
type: keyword
dimension: true
description: Supabase service producing the metric.
10 changes: 10 additions & 0 deletions packages/supabase/data_stream/metrics/manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
title: "Supabase Metrics"
type: metrics
elasticsearch:
index_mode: time_series
streams:
- package: prometheus_input_otel
title: Supabase Metrics
description: >
All metrics from the Supabase Metrics API: infrastructure (CPU, memory,
disk, network), PostgreSQL, Supavisor, PostgREST, Auth, Realtime, and Storage.
77 changes: 77 additions & 0 deletions packages/supabase/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Supabase OpenTelemetry Integration

Collect metrics from [Supabase](https://supabase.com) using the OpenTelemetry Prometheus receiver.

## Overview

This integration scrapes metrics from the Supabase Metrics API (Prometheus-compatible) using the OTel Collector's Prometheus receiver. All metrics are collected into a single data stream

- **Metrics** (`supabase.metrics.otel`) — Infrastructure (CPU, memory, load, disk I/O, filesystem, network), PostgreSQL (size, connections, transactions, cache, WAL, replication, bgwriter, statements), Supavisor, PostgREST, Auth, Realtime, and Storage

Metrics are stored with native OTel schema — no field renaming or custom mapping is applied. Raw Prometheus metric names are preserved under the `metrics.*` namespace.

## Compatibility

This integration requires a Supabase **Pro**, **Team**, or **Enterprise** plan. The Metrics API is not available on the Free tier.

## Prerequisites

| Requirement | Details |
|---|---|
| **Supabase plan** | Pro, Team, or Enterprise |
| **Elastic Stack** | 9.4.0+ |
| **Input package** | `prometheus_input_otel` (installed automatically as a dependency) |
| **Content package** | `supabase_otel` (installed automatically as a dependency) |

## Setup

1. **Get your Supabase credentials**:
- Go to your Supabase dashboard → **Settings** → **API**
- Copy the **Project URL** (e.g., `abcdefghijkl.supabase.co`)
- Copy the **service_role** key (under "Project API keys")

2. **Add the integration in Kibana**:
- Go to **Management** → **Integrations** → search for "Supabase"
- Click **Add Supabase**
- Fill in:
- **Targets**: `<your-project-ref>.supabase.co:443`
- **Username**: `service_role`
- **Service Role Key**: paste your service_role JWT

3. **Verify data**:
- Go to **Discover** and filter on `data_stream.dataset: "supabase.metrics.otel"`

## Dashboards

Kibana dashboards are provided by the **Supabase Dashboards** (`supabase_otel`) content package, which is installed automatically. The following dashboards are included:

- **Node & Infrastructure** — CPU, memory, load, disk I/O, filesystem, network
- **Database & Postgres Health** — connections, transactions, cache hit ratio, WAL, replication, bgwriter
- **Services & API Health** — Supavisor, PostgREST, GoTrue Auth, Realtime, Storage

## Metrics Reference

Metrics are scraped from the Supabase Metrics API endpoint:

```
GET https://<project-ref>.supabase.co/customer/v1/privileged/metrics
```

Authentication uses HTTP Basic Auth with `service_role` as the username and the service_role JWT as the password.

See the [Supabase Metrics documentation](https://supabase.com/docs/guides/telemetry/metrics) for full details on available metrics.

### Metric Categories

| Category | Prefix | Examples |
|---|---|---|
| Node / Infrastructure | `node_*` | `node_cpu_seconds_total`, `node_memory_MemAvailable_bytes`, `node_load5`, `node_disk_read_bytes_total` |
| PostgreSQL | `pg_*` | `pg_stat_database_xact_commit_total`, `pg_database_size_mb`, `pg_stat_bgwriter_buffers_alloc_total` |
| Supavisor | `supavisor_*` | `supavisor_connections_active`, `supavisor_pool_connections_idle`, `supavisor_client_queries_count_total` |
| PostgREST | `pgrst_*` | `pgrst_db_pool_available`, `pgrst_db_pool_timeouts_total`, `pgrst_schema_cache_query_time_seconds` |
| Auth (GoTrue) | `gotrue_*` | `gotrue_running`, `gotrue_compare_hash_and_password_completed_total` |
| Realtime | `realtime_*` | `realtime_postgres_changes_client_subscriptions` |
| Go Runtime | `go_*`, `process_*` | `go_goroutines`, `process_cpu_seconds_total`, `process_resident_memory_bytes` |
| HTTP | `http_*` | `http_server_request_duration_seconds_total`, `http_status_codes_total` |

All metrics are stored under the `metrics.*` field namespace with their original Prometheus names (e.g., `metrics.node_load5`, `metrics.pg_stat_database_xact_commit_total`).
24 changes: 24 additions & 0 deletions packages/supabase/img/supabase-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 109 additions & 0 deletions packages/supabase/manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
format_version: "3.6.2"
name: supabase
title: "Supabase"
version: 0.1.0
source:
license: "Elastic-2.0"
description: >-
Collect metrics from Supabase using the OTel Prometheus receiver.
Covers infrastructure, PostgreSQL, Supavisor, PostgREST, Auth,
Realtime, and Storage metrics.
type: integration
categories:
- observability
- monitoring
- cloud
- opentelemetry
conditions:
kibana:
version: "^9.4.0"
elastic:
subscription: basic
icons:
- src: /img/supabase-logo.svg
title: Supabase logo
size: 256x256
type: image/svg+xml
requires:
input:
- package: prometheus_input_otel
version: "0.1.1"
content:
- package: supabase_otel

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when installing this with elastic-package stack up i get an error, this package is not available yet? also, i have not seen it locally.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YEs this package will be merged soon.
Also say if we update the version on content package with some change. I am hoping this package automatically undestands to always pick the latest pacakge. Or is it expected to change the version of the content packa here too.
Version should be a minimum version criteria imo. Else it should always pick the latest
@teresaromero

version: "0.1.0"
policy_templates:
- name: supabase
title: Supabase Metrics
description: Collect metrics from Supabase's Prometheus-compatible Metrics API
data_streams:
- metrics
deployment_modes:
default:
enabled: true
agentless:
enabled: true
is_default: true
organization: observability
division: engineering
team: obs-infraobs-integrations
inputs:
- package: prometheus_input_otel
title: Supabase Metrics
description: Scrape Supabase metrics using the OTel Collector Prometheus receiver
vars:
- name: targets
type: text
title: Supabase Metrics Endpoint
required: true
multi: true
description: >
Supabase Metrics API endpoint in host:port format.
Use your project ref: <project-ref>.supabase.co:443
default:
- "<project-ref>.supabase.co:443"
show_user: true
- name: scrape_interval
type: duration
title: Scrape Interval
required: false
description: How frequently to scrape the Supabase metrics endpoint. Supabase recommends once per minute.
default: 60s
show_user: true
- name: metrics_path
type: text
title: Metrics Path
required: false
description: The HTTP resource path to fetch metrics from Supabase.
default: /customer/v1/privileged/metrics
show_user: true
- name: scheme
type: select
title: Scheme
required: false
description: Protocol scheme. Supabase Metrics API requires HTTPS.
default: https
show_user: false
options:
- text: HTTPS
value: https
- text: HTTP
value: http
- name: username
type: text
title: Username
required: true
description: >
HTTP Basic Auth username for the Supabase Metrics API.
default: "service_role"
show_user: true
- name: password
type: password
title: Service Role Key
required: true
description: >
The service_role JWT key from the Supabase dashboard
(Settings > API > Project API keys > service_role).

Check warning on line 105 in packages/supabase/manifest.yml

View workflow job for this annotation

GitHub Actions / Lint user-facing content

Elastic.MenuArrows: Use '→' to separate menu items, not '>' or '=>'. Example: Select Manage index → Add lifecycle policy.

Check warning on line 105 in packages/supabase/manifest.yml

View workflow job for this annotation

GitHub Actions / Lint user-facing content

Elastic.MenuArrows: Use '→' to separate menu items, not '>' or '=>'. Example: Select Manage index → Add lifecycle policy.
show_user: true
owner:
type: elastic
github: elastic/obs-infraobs-integrations
Loading