Supabase Cloud

Integration version1.0.0

Overview

Supabase is a Postgres development platform that provides a managed Postgres database with additional features including user authentication, client libraries, Edge Functions, Realtime subscriptions, Object Storage, and Vector embeddings. While Supabase supports a self-hosted version, this integration only supports Supabase Cloud project instances.

With this integration, you can, per Supabase project:

  • Collect essential Postgres Database metrics and monitor critical behavior on primary and replica instances.
  • Collect Postgres server OS metrics and monitor CPU, filesystem, memory, and network load.
  • Collect Postgres database logs which can include slow statements, errors, and audit statements.
  • Collect Supabase application layer logs from edge functions and Auth, REST, Storage, and Realtime APIs.
  • Collect business logic log messages from your edge function applications.

Setup

The Supabase Cloud integration requires the service_role API key to retrieve metrics from the hosted project’s metrics endpoint. If you want to collect logs, you also need a Personal Access Token to access the Supabase Management API.

If your Postgres log volume exceeds 200 messages per second, Datadog recommends using the Datadog Log Drain instead of this integration’s log collection feature.

Important: If you have a Datadog Log Drain configured for your Supabase project, disable it before enabling log collection via this integration to avoid duplicate logs.

Retrieve the service_role API key

  1. Log in to Supabase as an administrator.
  2. Navigate to Project Settings > API Keys.
  3. On the Legacy API Keys tab, retrieve the service_role API key.

Generate a Personal Access Token

A Personal Access Token (PAT) is required to access the Supabase Management API and collect logs.

  1. Log in to Supabase as an administrator or a user with appropriate permissions.

    Note: The Personal Access Token inherits the same permissions as the user who creates it. Since this integration only reads from the API, you can optionally create a user with read-only permissions:

    1. From the dashboard, navigate to Team.
    2. Click Invite member.
    3. In the Member-role dropdown, select Read-only.
    4. Complete the invitation and log in as the new user.
  2. Navigate to the Access Tokens page of the dashboard.

  3. Click Generate new token.

  4. Enter a name for the token, select Never for Expires in, and click Generate token.

  5. Copy the token value displayed at the top of the page. Store it securely, as it won’t be displayed again.

Connect your Supabase Cloud project to Datadog

  1. In the Datadog app, navigate to the Supabase Cloud integration tile and add your Supabase hosted project ID and service_role API key:

    ParameterDescription
    Project IDSupabase project ID. For example: https://supabase.com/dashboard/project/<project_id>/settings/general.
    service_role API keyAPI key needed for communication with the Metrics endpoint.
    Collect LogsEnable this option to collect logs from your Supabase project instead of using a Datadog Log Drain.
    Personal Access TokenToken needed for communication with the Management API. Required only if Collect Logs is enabled.
  2. Click Save.

Data Collected

Metrics

supabase.cloud.auth_users.user_count
(gauge)
The number of users in the project database.
Shown as user
supabase.cloud.connection.stats.connection.count
(gauge)
The number of connections to the project database.
Shown as user
supabase.cloud.node.cpu.online
(count)
The CPU is online.
supabase.cloud.node.cpu.seconds.count
(count)
The number of seconds the CPUs spent in each mode.
Shown as second
supabase.cloud.node.disk.filesystem.info
(gauge)
The disk filesystem description.
supabase.cloud.node.disk.info
(gauge)
The disk device name, model, etc. described via tags.
supabase.cloud.node.disk.io_time_seconds.count
(count)
The total seconds spent doing I/Os.
Shown as second
supabase.cloud.node.disk.io_time_weighted_seconds.count
(count)
The weighted # of seconds spent doing I/Os.
supabase.cloud.node.disk.read_bytes.count
(count)
The total number of bytes read successfully.
Shown as byte
supabase.cloud.node.disk.read_time_seconds.count
(count)
The total number of seconds spent by all reads.
supabase.cloud.node.disk.write_time_seconds.count
(count)
This is the total number of seconds spent by all writes.
Shown as second
supabase.cloud.node.disk.written_bytes.count
(count)
The total number of bytes written successfully.
Shown as byte
supabase.cloud.node.filesystem.avail.bytes
(gauge)
The filesystem space available to non-root users in bytes.
Shown as byte
supabase.cloud.node.filesystem.device_error
(gauge)
Whether an error occurred while getting statistics for the given device.
supabase.cloud.node.filesystem.size_bytes
(gauge)
The filesystem size in bytes
Shown as byte
supabase.cloud.node.load1
(gauge)
1m load average.
supabase.cloud.node.load15
(gauge)
15m load average.
supabase.cloud.node.load5
(gauge)
5m load average.
supabase.cloud.node.memory.active_bytes
(gauge)
Memory information field Active_bytes.
Shown as byte
supabase.cloud.node.memory.buffers.bytes
(gauge)
Memory information field Buffers_bytes.
Shown as byte
supabase.cloud.node.memory.cached_byte.
(gauge)
Memory information field Cached_bytes.
Shown as byte
supabase.cloud.node.memory.inactive.bytes
(gauge)
Memory information field Inactive_bytes.
Shown as byte
supabase.cloud.node.memory.mem_available.bytes
(gauge)
Memory information field MemAvailable_bytes.
Shown as byte
supabase.cloud.node.memory.mem_free.bytes
(gauge)
Memory information field MemFree_bytes.
Shown as byte
supabase.cloud.node.memory.mem_total.bytes
(gauge)
Memory information field MemTotal_bytes.
Shown as byte
supabase.cloud.node.memory.swap_free.bytes
(gauge)
Memory information field SwapFree_bytes.
Shown as byte
supabase.cloud.node.memory.swap_total.bytes
(gauge)
Memory information field SwapTotal_bytes.
Shown as byte
supabase.cloud.node.network.receive_bytes.count
(count)
Network device statistic receive_bytes.
Shown as byte
supabase.cloud.node.network.transmit_bytes.count
(count)
Network device statistic transmit_bytes.
Shown as byte
supabase.cloud.node.vmstat.oom_kill.count
(count)
/proc/vmstat information field oom_kill.
supabase.cloud.pg.up
(gauge)
Whether the last scrape of metrics from PostgreSQL was able to connect to the server.
supabase.cloud.pg_database.size.mb
(gauge)
Disk space used by the database.
Shown as megabyte
supabase.cloud.pg_stat_bgwriter.buffers_alloc.count
(count)
Buffers allocated
supabase.cloud.pg_stat_bgwriter.buffers_checkpoint.count
(count)
Buffers written during checkpoints
supabase.cloud.pg_stat_bgwriter.buffers_clean.count
(count)
Buffers written by bg writter
supabase.cloud.pg_stat_bgwriter.checkpoint_sync_time.count
(count)
Time spent synchronizing checkpoint files to disk
supabase.cloud.pg_stat_bgwriter.checkpoint_write_time.count
(count)
Time spent writing checkpoint files to disk
supabase.cloud.pg_stat_bgwriter.checkpoints_req.count
(count)
Requested checkpoints performed
supabase.cloud.pg_stat_bgwriter.checkpoints_timed.count
(count)
Scheduled checkpoints performed
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
supabase.cloud.pg_stat_bgwriter.stats_reset.count
(count)
Most recent stat reset time
supabase.cloud.pg_stat_database.blks_hit.count
(count)
Disk blocks found in buffer cache
supabase.cloud.pg_stat_database.blks_read.count
(count)
Number of disk blocks read
supabase.cloud.pg_stat_database.deadlocks.count
(count)
Deadlocks detected
supabase.cloud.pg_stat_database.num_backends
(gauge)
The number of active backends
supabase.cloud.pg_stat_database.temp_bytes.count
(count)
Temp data written by queries
Shown as byte
supabase.cloud.pg_stat_database.temp_files.count
(count)
Temp files created by queries
supabase.cloud.pg_stat_database.tup_deleted.count
(count)
Rows deleted
supabase.cloud.pg_stat_database.tup_fetched.count
(count)
Rows fetched by queries
supabase.cloud.pg_stat_database.tup_inserted.count
(count)
Rows inserted
supabase.cloud.pg_stat_database.tup_returned.count
(count)
Rows returned by queries
supabase.cloud.pg_stat_database.tup_updated.count
(count)
Rows updated
supabase.cloud.pg_stat_database.xact_commit.count
(count)
Transactions committed
supabase.cloud.pg_stat_database.xact_rollback.count
(count)
Transactions rolled back
supabase.cloud.pg_status.in_recovery
(gauge)
Database in recovery
supabase.cloud.pg_wal.size
(gauge)
Disk space used by WAL files
Shown as megabyte
supabase.cloud.pgrst.db_pool.available_connections
(gauge)
Available connections in the pool
Shown as connection
supabase.cloud.pgrst.db_pool.max_connections
(gauge)
Max pool connections
Shown as connection
supabase.cloud.pgrst.db_pool.timeouts.count
(count)
The total number of pool connection timeouts
Shown as connection
supabase.cloud.pgrst.db_pool.waiting
(gauge)
Requests waiting to acquire a pool connection
supabase.cloud.pgrst.schema_cache.loads.count
(count)
The total number of times the schema cache was loaded
supabase.cloud.pgrst.schema_cache.query_time_seconds
(gauge)
The query time in seconds of the last schema cache load
Shown as second
supabase.cloud.postgresql.restarts.count
(count)
Number of times postgresql has been restarted
supabase.cloud.realtime_postgres_changes.client_subscriptions
(gauge)
Client subscriptions listening for Postgres changes
supabase.cloud.realtime_postgres_changes.total_subscriptions
(gauge)
Total subscription records listening for Postgres changes

Logs

When you enable log collection for this integration, all Postgres and application log messages are collected using the Management API. Alternatively, you can use a Datadog Log Drain in Supabase to deliver logs to Datadog. Regardless of the delivery method, this integration uses Datadog’s built-in log pipelines to parse and enrich the logs for easier searching and more detailed insights.

Events

The Supabase Cloud integration does not include any events.

Service Checks

The Supabase Cloud integration does not include any service checks.

Troubleshooting

Need help? Contact Datadog support.