Navigation

Prometheus metrics for PlanetScale for Postgres

Postgres

(Updated )

Overview

PlanetScale for Postgres exposes a Prometheus-compatible endpoint per-branch that allows you to scrape metrics for your database.

See our Prometheus integration documentation for how to set Prometheus up to automatically discover and scrape metrics for your database branches.

If you're using Datadog, see our Datadog tutorial for how to setup your Datadog agent to scrape metrics for your branch.

Metrics

PlanetScale for Postgres emits the following metrics to be scraped.

Database Metrics

Name & DescriptionTypeTags

planetscale_postgres_connection_state

The count and state of Postgres connections

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_connection_state, planetscale_role, planetscale_cell, planetscale_component

planetscale_postgres_wal_archiver_succeeded_count

The count of successfully archived WALs

Counter

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_role, planetscale_cell, planetscale_component

planetscale_postgres_wal_archiver_failed_count

The count of unsuccessfully archived WALs

Counter

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_role, planetscale_cell, planetscale_component

planetscale_postgres_wal_archiver_last_age_succeeded

The age of the last successfully archived WAL

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_role, planetscale_cell, planetscale_component

planetscale_postgres_wal_size_bytes

The cumulative disk size of WALs waiting to be archived

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_role, planetscale_cell, planetscale_component

planetscale_postgres_settings_max_connections

The current value of the max_connections setting

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_role, planetscale_cell, planetscale_component

planetscale_postgres_settings_max_wal_size_bytes

The current value of the max_wal_size_bytes setting

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_role, planetscale_cell, planetscale_component

planetscale_postgres_replica_lag_seconds

Replica lag in fine-grained seconds from Postgres

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_role, planetscale_cell, planetscale_component

planetscale_postgres_locks

Count of current lock modes

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_lock_mode, planetscale_role, planetscale_cell, planetscale_component

planetscale_postgres_database_xact_commit_total

Total committed transactions on Postgres databases

Counter

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_database_name, planetscale_role, planetscale_cell, planetscale_component

Edge Metrics

Name & DescriptionTypeTags

planetscale_edge_postgres_active_connections

The number of active Postgres and PSBouncer connections to the branch

Gauge

cluster, planetscale_database_branch_id, planetscale_port, planetscale_region

planetscale_edge_postgres_connection_drops_total

The total number of Postgres and PSBouncer connections that have been dropped

Counter

cluster, planetscale_database_branch_id, planetscale_port, planetscale_region

planetscale_edge_postgres_connection_errors_total

The total number of Postgres and PSBouncer connections that have resulted in an error

Counter

cluster, planetscale_database_branch_id, planetscale_port, planetscale_region

PSBouncer Metrics

Name & DescriptionTypeTags

planetscale_psbouncer_total_peers

The total count of peered processes PSBouncer is running

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component

planetscale_psbouncer_cpu_util_per_peer_percentages

CPU utilization percentage of PSBouncer peered processes

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component

planetscale_psbouncer_current_connections

The current count PSBouncer connections to Postgres

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component

planetscale_psbouncer_current_client_connections

The current count client connections to PSBouncer

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component

planetscale_psbouncer_pools_client

The count and state of PSBouncer client connections

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_psbouncer_pool, planetscale_role, planetscale_cell, planetscale_component

planetscale_psbouncer_pools_client_maxwait_seconds

How long the first client connection has waited to connect to PSBouncer

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component

planetscale_psbouncer_pools_server

The count and state of PSBouncer server connections

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_psbouncer_pool, planetscale_role, planetscale_cell, planetscale_component

Infrastructure Metrics

Name & DescriptionTypeTags

planetscale_pods_cpu_util_percentages

CPU utilization percentage of database pods

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component

planetscale_pods_mem_util_percentages

Memory utilization percentage of database pods

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component

planetscale_pods_iops_total

Total IOPS (Input/Output Operations Per Second) of database pods

Counter

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component

planetscale_volume_available_bytes

Available storage space in bytes on Postgres volumes

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_role, planetscale_cell, planetscale_component

planetscale_volume_capacity_bytes

Total storage capacity in bytes on Postgres volumes

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_role, planetscale_cell, planetscale_component

planetscale_pods_mem_rss_bytes

RSS memory usage in bytes of database pods

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component

planetscale_pods_mem_mmap_bytes

Memory-mapped file usage in bytes of database pods

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component

planetscale_pods_mem_active_cache_bytes

Active cache memory in bytes of database pods

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component

planetscale_pods_mem_inactive_cache_bytes

Inactive cache memory in bytes of database pods

Gauge

cluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component

Tag Glossary

  • cluster: The PlanetScale cluster identifier
  • planetscale_database_branch_id: The unique identifier for the database branch
  • planetscale_pod: The Kubernetes pod name
  • planetscale_container: The container name (postgres, psbouncer, walg-daemon)
  • planetscale_role: The database role (primary, replica)
  • planetscale_cell: The PlanetScale cell identifier
  • planetscale_component: The PlanetScale component identifier
  • planetscale_connection_state: The state of database connections
  • planetscale_lock_mode: The PostgreSQL lock mode
  • planetscale_database_name: The PostgreSQL database name
  • planetscale_port: The connection port number
  • planetscale_region: The geographic region
  • planetscale_psbouncer_pool: The PSBouncer connection pool identifier

Need help?

Get help from the PlanetScale Support team, or join our GitHub discussion board to see how others are using PlanetScale.