Overview

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 connectionsGaugecluster, 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 WALsCountercluster, planetscale_database_branch_id, planetscale_pod, planetscale_role, planetscale_cell, planetscale_component
planetscale_postgres_wal_archiver_failed_count The count of unsuccessfully archived WALsCountercluster, 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 WALGaugecluster, 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 archivedGaugecluster, planetscale_database_branch_id, planetscale_pod, planetscale_role, planetscale_cell, planetscale_component
planetscale_postgres_settings_max_connections The current value of the max_connections settingGaugecluster, 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 settingGaugecluster, planetscale_database_branch_id, planetscale_pod, planetscale_role, planetscale_cell, planetscale_component
planetscale_postgres_replica_lag_seconds Replica lag in fine-grained seconds from PostgresGaugecluster, planetscale_database_branch_id, planetscale_pod, planetscale_role, planetscale_cell, planetscale_component
planetscale_postgres_locks Count of current lock modesGaugecluster, 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 databasesCountercluster, 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 PgBouncer connections to the branchGaugecluster, planetscale_database_branch_id, planetscale_port, planetscale_region
planetscale_edge_postgres_connection_drops_total The total number of Postgres and PgBouncer connections that have been droppedCountercluster, planetscale_database_branch_id, planetscale_port, planetscale_region
planetscale_edge_postgres_connection_errors_total The total number of Postgres and PgBouncer connections that have resulted in an errorCountercluster, planetscale_database_branch_id, planetscale_port, planetscale_region
planetscale_edge_postgres_bytes_sent_total The total number of Postgres and PgBouncer bytes sentCountercluster, planetscale_database_branch_id, planetscale_port, planetscale_connector_id, planetscale_region
planetscale_edge_postgres_bytes_received_total The total number of Postgres and PgBouncer bytes receivedCountercluster, planetscale_database_branch_id, planetscale_port, planetscale_connector_id, planetscale_region

PgBouncer Metrics

Name & DescriptionTypeTags
planetscale_pgbouncer_total_peers The total count of peered processes PgBouncer is runningGaugecluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component
planetscale_pgbouncer_cpu_util_per_peer_percentages CPU utilization percentage of PgBouncer peered processesGaugecluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component
planetscale_pgbouncer_current_connections The current count PgBouncer connections to PostgresGaugecluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component
planetscale_pgbouncer_current_client_connections The current count client connections to PgBouncerGaugecluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component
planetscale_pgbouncer_pools_client The count and state of PgBouncer client connectionsGaugecluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_pgbouncer_pool, planetscale_role, planetscale_cell, planetscale_component
planetscale_pgbouncer_pools_client_maxwait_seconds How long the first client connection has waited to connect to PgBouncerGaugecluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component
planetscale_pgbouncer_pools_server The count and state of PgBouncer server connectionsGaugecluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_pgbouncer_pool, planetscale_role, planetscale_cell, planetscale_component

Infrastructure Metrics

Name & DescriptionTypeTags
planetscale_pods_cpu_util_percentages CPU utilization percentage of database podsGaugecluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component
planetscale_pods_mem_util_percentages Memory utilization percentage of database podsGaugecluster, 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 podsCountercluster, 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 volumesGaugecluster, planetscale_database_branch_id, planetscale_pod, planetscale_role, planetscale_cell, planetscale_component
planetscale_volume_capacity_bytes Total storage capacity in bytes on Postgres volumesGaugecluster, planetscale_database_branch_id, planetscale_pod, planetscale_role, planetscale_cell, planetscale_component
planetscale_pods_mem_rss_bytes RSS memory usage in bytes of database podsGaugecluster, 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 podsGaugecluster, 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 podsGaugecluster, 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 podsGaugecluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component
planetscale_pods_container_restarts_total Total container restart events detectedCountercluster, planetscale_database_branch_id, planetscale_pod, planetscale_container, planetscale_role, planetscale_cell, planetscale_component, planetscale_restart_reason

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, pgbouncer, 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_pgbouncer_pool: The PgBouncer connection pool identifier
  • planetscale_connector_id: The edge connector identifier
  • planetscale_restart_reason: The reason for container restart

Need help?

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