-
Notifications
You must be signed in to change notification settings - Fork 621
Supabase OpenTelemetry Integration Package #20130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ishleenk17
merged 14 commits into
elastic:main
from
ishleenk17:supabase_otel_integration
Jul 31, 2026
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ec8061c
Supabase OpenTelemetry Integration Package
ishleenk17 5d313c9
Add codeonwer
ishleenk17 3fee9b4
Remove sample json for now
ishleenk17 20cd63b
Remove field mapping
ishleenk17 a01cad9
Update changelog
ishleenk17 89057cd
update README
ishleenk17 2262dfb
Change package name
ishleenk17 0dff13c
udpate codeowner
ishleenk17 4e46af2
Enable TSDS manually on the metrics datastreeams
ishleenk17 ab8360a
Merge branch 'main' into supabase_otel_integration
ishleenk17 fd13112
Refer to correct version of Supabase OTel integration
ishleenk17 8659ce6
Update changelog.yml
ishleenk17 27de0ac
Update README and manifest
ishleenk17 b647dc4
Update README
ishleenk17 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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`). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # newer versions go on top | ||
| - 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
16
packages/supabase/data_stream/metrics/fields/base-fields.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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`). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| 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
|
||
| show_user: true | ||
| owner: | ||
| type: elastic | ||
| github: elastic/obs-infraobs-integrations | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 upi get an error, this package is not available yet? also, i have not seen it locally.There was a problem hiding this comment.
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