Skip to content

Commit a4a801c

Browse files
[SIMI-271] Supabase Cloud: no-assets, define label (#21811)
* Supabase Cloud: no-assets, define label * Update labeler.yml with supabase_cloud * Supabase Cloud: remove unnecessary IMAGES_README.md * Supabase Cloud: no-assets, define label * Update labeler.yml with supabase_cloud * Supabase Cloud: remove unnecessary IMAGES_README.md * Supabase Cloud: Update README.md setup instructions based on Personal Access Token * Supabase Cloud: Update README with info on replica metrics gathering --------- Co-authored-by: jeff-morgan-dd <jeff.morgan@datadoghq.com>
1 parent d6182b7 commit a4a801c

File tree

6 files changed

+224
-0
lines changed

6 files changed

+224
-0
lines changed

.github/workflows/config/labeler.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,8 @@ integration/strimzi:
675675
- strimzi/**/*
676676
integration/supabase:
677677
- supabase/**/*
678+
integration/supabase_cloud:
679+
- supabase_cloud/**/*
678680
integration/supervisord:
679681
- supervisord/**/*
680682
integration/supply_chain_firewall:

supabase_cloud/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# CHANGELOG - Supabase Cloud
2+
3+
## 1.0.0 / 2025-12-09
4+
5+
***Added***:
6+
7+
* Initial Release with support for Supabase project metrics and log collection via Supabase Management API.

supabase_cloud/README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
## Overview
2+
3+
[Supabase][2] is a Postgres development platform that provides a managed Postgres database with additional features including
4+
user authentication, client libraries, Edge Functions, Realtime subscriptions, Object Storage, and Vector embeddings.
5+
While Supabase supports a self-hosted version, this integration only supports Supabase Cloud project instances.
6+
7+
With this integration, you can, per Supabase project:
8+
- Collect essential Postgres Database metrics and monitor critical behavior on primary and replica instances.
9+
- Collect Postgres server OS metrics and monitor CPU/Filesystem/Memory/Network load.
10+
- Collect Postgres database logs which can include slow statements, errors, and audit statements.
11+
- Collect Supabase application layer logs from edge functions and Auth/REST/Storage/Realtime APIs.
12+
- Collect business logic log messages from your edge function applications.
13+
14+
## Setup
15+
16+
The Supabase Cloud integration requires the `service_role` API key to retrieve metrics from the hosted project's
17+
[metrics endpoint][4] and the use of a [Personal Access Token][7] to access the Supabase [Management API][6] for reading logs
18+
if you choose to do so.
19+
20+
If your Postgres log volume is continually greater than 200 messages/sec, Datadog recommends that you enable the
21+
[Datadog Log Drain][3] in your Supabase project and not select log collection via this integration.
22+
If you choose to collect logs via this integration and currently have a Datadog Log Drain set up for your Supabase project, please disable it before proceeding.
23+
The logs collected from the Management API will be duplicate to those of the Log Drain.
24+
25+
### Retrieve the service_role API key
26+
27+
1. Log in to [Supabase][2] as an administrator.
28+
2. Navigate to **Project Settings** > **API Keys**.
29+
3. On the **Legacy API Keys** tab, retrieve the service_role API key.
30+
31+
### Generate a Personal Access Token
32+
A Personal Access Token, PAT, is required to access the Supabase Management API and collect logs. The PAT inherits
33+
the same permissions as the user who creates it. Since this integration only reads from the API, you have the option
34+
to generate the PAT from a user in your organization with read-only permissions.
35+
36+
1. Log in to [Supabase][2] as an administrator.
37+
2. (Optional) Create a user with read-only permissions and log in as that user.
38+
1. From the dashboard, navigate to **Team**
39+
2. Click **Invite member**
40+
3. In the **Member-role** dropdown, select **Read-only**.
41+
4. Complete the invitation and log in as the new user.
42+
2. Navigate to the [Access Tokens page][7] of the dashboard.
43+
3. Click on **Generate new token**.
44+
4. Enter a name for the token, select the **Expires in** value _Never_ and click **Generate token**.
45+
5. Note the token value at the top of the Access Tokens page and copy it for later use as it will not be displayed again.
46+
47+
### Connect your Supabase Cloud project to Datadog
48+
49+
1. Add your Supabase hosted project ID and service_role API key
50+
|Parameters|Description|
51+
|--------------------|--------------------|
52+
|Project ID|Supabase project ID: E.g. `https://supabase.com/dashboard/project/<project_id>/settings/general`.|
53+
|Service_role API Key|API key needed for communication with the Metrics endpoint.|
54+
|Collect Logs|Enable this option to collect logs from your Supabase project instead of using a [Datadog Log Drain][3].|
55+
|Personal Access Token|Token needed for communication with the Management API.|
56+
57+
2. Click the **Save** button to save your settings.
58+
59+
## Data Collected
60+
61+
### Metrics
62+
63+
See [metadata.csv][5] for the full list of metrics provided by this integration.
64+
65+
If your project contains a Postgres read replica **and** you provide a Personal Access Token to the integration,
66+
the integration will also collect metrics from the read replica, tagging the metrics with the appropriate
67+
`supabase_identifier` value.
68+
69+
### Logs
70+
71+
When you enable this integration for your Supabase hosted project and choose to collect logs, all Postgres and application log
72+
messages will be collected using the [Management API][6]. Alternatively, a [Datadog Log Drain][3] in Supabase can be used to
73+
deliver logs to Datadog. Regardless of how the log messages are delivered, this integration leverages Datadog's built-in log pipelines
74+
to parse and enrich the logs, facilitating easy search and detailed insights.
75+
76+
### Events
77+
78+
The Supabase Cloud integration does not include any events.
79+
80+
### Service Checks
81+
82+
The Supabase Cloud integration does not include any service checks.
83+
84+
## Troubleshooting
85+
86+
Need help? Contact [Datadog support][1].
87+
88+
[1]: https://docs.datadoghq.com/help/
89+
[2]: https://supabase.com/
90+
[3]: https://supabase.com/docs/guides/telemetry/log-drains
91+
[4]: https://supabase.com/docs/guides/telemetry/metrics
92+
[5]: https://github.com/DataDog/integrations-core/blob/master/supabase_cloud/metadata.csv
93+
[6]: https://supabase.com/docs/reference/api/introduction
94+
[7]: https://supabase.com/dashboard/account/tokens
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

supabase_cloud/manifest.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"manifest_version": "2.0.0",
3+
"app_uuid": "76054e37-5919-442f-a7a6-5a77ed5e7b0e",
4+
"app_id": "supabase-cloud",
5+
"display_on_public_website": false,
6+
"tile": {
7+
"overview": "README.md#Overview",
8+
"configuration": "README.md#Setup",
9+
"support": "README.md#Support",
10+
"changelog": "CHANGELOG.md",
11+
"description": "Monitor the activity, health, and performance of your Supabase Cloud projects.",
12+
"title": "Supabase Cloud",
13+
"media": [],
14+
"classifier_tags": [
15+
"Category::Cloud",
16+
"Category::Developer Tools",
17+
"Category::Metrics",
18+
"Category::Log Collection",
19+
"Offering::Integration",
20+
"Submitted Data Type::Metrics",
21+
"Submitted Data Type::Logs"
22+
]
23+
},
24+
"assets": {
25+
"integration": {
26+
"auto_install": false,
27+
"source_type_id": 60482379,
28+
"source_type_name": "Supabase Cloud",
29+
"events": {
30+
"creates_events": false
31+
},
32+
"metrics": {
33+
"prefix": "supabase.cloud.",
34+
"check": [
35+
"supabase.cloud.pg.up",
36+
"supabase.cloud.pg_database.size.mb"
37+
],
38+
"metadata_path": "metadata.csv"
39+
},
40+
"service_checks": {
41+
"metadata_path": "assets/service_checks.json"
42+
}
43+
},
44+
"dashboards": {},
45+
"monitors": {},
46+
"saved_views": {}
47+
},
48+
"author": {
49+
"support_email": "help@datadoghq.com",
50+
"name": "Datadog",
51+
"homepage": "https://www.datadoghq.com",
52+
"sales_email": "info@datadoghq.com"
53+
}
54+
}

supabase_cloud/metadata.csv

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
metric_name,metric_type,interval,unit_name,per_unit_name,description,orientation,integration,short_name,curated_metric,sample_tags
2+
supabase.cloud.auth_users.user_count,gauge,,user,,The number of users in the project database.,0,supabase_cloud,,,
3+
supabase.cloud.connection.stats.connection.count,gauge,,user,,The number of connections to the project database.,0,supabase_cloud,,,
4+
supabase.cloud.node.cpu.online,count,,,,The CPU is online.,0,supabase_cloud,,,
5+
supabase.cloud.node.cpu.seconds.count,count,,second,,The number of seconds the CPUs spent in each mode.,0,supabase_cloud,,,
6+
supabase.cloud.node.disk.filesystem.info,gauge,,,,The disk filesystem description.,0,supabase_cloud,,,
7+
supabase.cloud.node.disk.info,gauge,,,,"The disk device name, model, etc. described via tags.",0,supabase_cloud,,,
8+
supabase.cloud.node.disk.io_time_seconds.count,count,,second,,The total seconds spent doing I/Os.,0,supabase_cloud,,,
9+
supabase.cloud.node.disk.io_time_weighted_seconds.count,count,,,,The weighted # of seconds spent doing I/Os.,0,supabase_cloud,,,
10+
supabase.cloud.node.disk.read_bytes.count,count,,byte,,The total number of bytes read successfully.,0,supabase_cloud,,,
11+
supabase.cloud.node.disk.read_time_seconds.count,count,,,,The total number of seconds spent by all reads.,0,supabase_cloud,,,
12+
supabase.cloud.node.disk.write_time_seconds.count,count,,second,,This is the total number of seconds spent by all writes.,0,supabase_cloud,,,
13+
supabase.cloud.node.disk.written_bytes.count,count,,byte,,The total number of bytes written successfully.,0,supabase_cloud,,,
14+
supabase.cloud.node.filesystem.avail.bytes,gauge,,byte,,The filesystem space available to non-root users in bytes.,0,supabase_cloud,,,
15+
supabase.cloud.node.filesystem.device_error,gauge,,,,Whether an error occurred while getting statistics for the given device.,0,supabase_cloud,,,
16+
supabase.cloud.node.filesystem.size_bytes,gauge,,byte,,The filesystem size in bytes,0,supabase_cloud,,,
17+
supabase.cloud.node.load1,gauge,,,,1m load average.,0,supabase_cloud,,,
18+
supabase.cloud.node.load15,gauge,,,,15m load average.,0,supabase_cloud,,,
19+
supabase.cloud.node.load5,gauge,,,,5m load average.,0,supabase_cloud,,,
20+
supabase.cloud.node.memory.active_bytes,gauge,,byte,,Memory information field Active_bytes.,0,supabase_cloud,,,
21+
supabase.cloud.node.memory.buffers.bytes,gauge,,byte,,Memory information field Buffers_bytes.,0,supabase_cloud,,,
22+
supabase.cloud.node.memory.cached_byte.,gauge,,byte,,Memory information field Cached_bytes.,0,supabase_cloud,,,
23+
supabase.cloud.node.memory.inactive.bytes,gauge,,byte,,Memory information field Inactive_bytes.,0,supabase_cloud,,,
24+
supabase.cloud.node.memory.mem_available.bytes,gauge,,byte,,Memory information field MemAvailable_bytes.,0,supabase_cloud,,,
25+
supabase.cloud.node.memory.mem_free.bytes,gauge,,byte,,Memory information field MemFree_bytes.,0,supabase_cloud,,,
26+
supabase.cloud.node.memory.mem_total.bytes,gauge,,byte,,Memory information field MemTotal_bytes.,0,supabase_cloud,,,
27+
supabase.cloud.node.memory.swap_free.bytes,gauge,,byte,,Memory information field SwapFree_bytes.,0,supabase_cloud,,,
28+
supabase.cloud.node.memory.swap_total.bytes,gauge,,byte,,Memory information field SwapTotal_bytes.,0,supabase_cloud,,,
29+
supabase.cloud.node.network.receive_bytes.count,count,,byte,,Network device statistic receive_bytes.,0,supabase_cloud,,,
30+
supabase.cloud.node.network.transmit_bytes.count,count,,byte,,Network device statistic transmit_bytes.,0,supabase_cloud,,,
31+
supabase.cloud.node.vmstat.oom_kill.count,count,,,,/proc/vmstat information field oom_kill.,0,supabase_cloud,,,
32+
supabase.cloud.pg.up,gauge,,,,Whether the last scrape of metrics from PostgreSQL was able to connect to the server.,0,supabase_cloud,,,
33+
supabase.cloud.pg_database.size.mb,gauge,,megabyte,,Disk space used by the database.,0,supabase_cloud,,,
34+
supabase.cloud.pg_stat_bgwriter.buffers_alloc.count,count,,,,Buffers allocated,0,supabase_cloud,,,
35+
supabase.cloud.pg_stat_bgwriter.buffers_checkpoint.count,count,,,,Buffers written during checkpoints,0,supabase_cloud,,,
36+
supabase.cloud.pg_stat_bgwriter.buffers_clean.count,count,,,,Buffers written by bg writter,0,supabase_cloud,,,
37+
supabase.cloud.pg_stat_bgwriter.checkpoint_sync_time.count,count,,,,Time spent synchronizing checkpoint files to disk,0,supabase_cloud,,,
38+
supabase.cloud.pg_stat_bgwriter.checkpoint_write_time.count,count,,,,Time spent writing checkpoint files to disk,0,supabase_cloud,,,
39+
supabase.cloud.pg_stat_bgwriter.checkpoints_req.count,count,,,,Requested checkpoints performed,0,supabase_cloud,,,
40+
supabase.cloud.pg_stat_bgwriter.checkpoints_timed.count,count,,,,Scheduled checkpoints performed,0,supabase_cloud,,,
41+
supabase.cloud.pg_stat_bgwriter.maxwritten_clean.count,count,,,,Number of times bg writer stopped a cleaning scan because it had written too many buffers,0,supabase_cloud,,,
42+
supabase.cloud.pg_stat_bgwriter.stats_reset.count,count,,,,Most recent stat reset time,0,supabase_cloud,,,
43+
supabase.cloud.pg_stat_database.blks_hit.count,count,,,,Disk blocks found in buffer cache,0,supabase_cloud,,,
44+
supabase.cloud.pg_stat_database.blks_read.count,count,,,,Number of disk blocks read,0,supabase_cloud,,,
45+
supabase.cloud.pg_stat_database.deadlocks.count,count,,,,Deadlocks detected,0,supabase_cloud,,,
46+
supabase.cloud.pg_stat_database.num_backends,gauge,,,,The number of active backends,0,supabase_cloud,,,
47+
supabase.cloud.pg_stat_database.temp_bytes.count,count,,byte,,Temp data written by queries,0,supabase_cloud,,,
48+
supabase.cloud.pg_stat_database.temp_files.count,count,,,,Temp files created by queries,0,supabase_cloud,,,
49+
supabase.cloud.pg_stat_database.tup_deleted.count,count,,,,Rows deleted,0,supabase_cloud,,,
50+
supabase.cloud.pg_stat_database.tup_fetched.count,count,,,,Rows fetched by queries,0,supabase_cloud,,,
51+
supabase.cloud.pg_stat_database.tup_inserted.count,count,,,,Rows inserted,0,supabase_cloud,,,
52+
supabase.cloud.pg_stat_database.tup_returned.count,count,,,,Rows returned by queries,0,supabase_cloud,,,
53+
supabase.cloud.pg_stat_database.tup_updated.count,count,,,,Rows updated,0,supabase_cloud,,,
54+
supabase.cloud.pg_stat_database.xact_commit.count,count,,,,Transactions committed,0,supabase_cloud,,,
55+
supabase.cloud.pg_stat_database.xact_rollback.count,count,,,,Transactions rolled back,0,supabase_cloud,,,
56+
supabase.cloud.pg_status.in_recovery,gauge,,,,Database in recovery,0,supabase_cloud,,,
57+
supabase.cloud.pg_wal.size,gauge,,megabyte,,Disk space used by WAL files,0,supabase_cloud,,,
58+
supabase.cloud.pgrst.db_pool.available_connections,gauge,,connection,,Available connections in the pool,0,supabase_cloud,,,
59+
supabase.cloud.pgrst.db_pool.max_connections,gauge,,connection,,Max pool connections,0,supabase_cloud,,,
60+
supabase.cloud.pgrst.db_pool.timeouts.count,count,,connection,,The total number of pool connection timeouts,0,supabase_cloud,,,
61+
supabase.cloud.pgrst.db_pool.waiting,gauge,,,,Requests waiting to acquire a pool connection,0,supabase_cloud,,,
62+
supabase.cloud.pgrst.schema_cache.loads.count,count,,,,The total number of times the schema cache was loaded,0,supabase_cloud,,,
63+
supabase.cloud.pgrst.schema_cache.query_time_seconds,gauge,,second,,The query time in seconds of the last schema cache load,0,supabase_cloud,,,
64+
supabase.cloud.postgresql.restarts.count,count,,,,Number of times postgresql has been restarted,0,supabase_cloud,,,
65+
supabase.cloud.realtime_postgres_changes.client_subscriptions,gauge,,,,Client subscriptions listening for Postgres changes,0,supabase_cloud,,,
66+
supabase.cloud.realtime_postgres_changes.total_subscriptions,gauge,,,,Total subscription records listening for Postgres changes,0,supabase_cloud,,,

0 commit comments

Comments
 (0)