Skip to content

PostgreSQL

Monitor PostgreSQL 10.x and above with SQL queries from the Component Agent.

5 min read Updated SS

Supported Components and Versions#

LAYER COMPONENT VERSION
DB Server PostgreSQL 10.x and above

Monitoring Strategies for Components#

Monitoring of these DB servers is using database specific SQL queries triggered from HEAL’s Component Agent. The component agent can reside on the same host, or it can trigger these queries remotely.

KPIs collected#

Component Name kpi_name kpi_identifier KpiDescription Units
PostgreSQL Idx Scan pg_idx_scan Number of index scans executed by the database. Count
PostgreSQL Seq Scan pg_seq_scan Number of sequential scans on a table Count
PostgreSQL N Tup Ins pg_n_tup_ins Indicates the number of rows inserted into a table. Count
PostgreSQL N Tup Upd pg_n_tup_upd Indicates the number of rows updated in a table. Count
PostgreSQL N Tup Del pg_n_tup_del Indicates the number of rows deleted from a table. Count
PostgreSQL N Tup Hot Upd pg_n_tup_hot_upd Indicates the number of rows that were updated using a hot update technique. Count
PostgreSQL N Dead Tup pg_n_dead_tup Indicates the number of dead tuples in a table. Count
PostgreSQL Tup Fetched pg_tup_fetched Rows fetched by queries to the database Count
PostgreSQL Tup Returned pg_tup_returned Rows returned by queries to the database Count
PostgreSQL Temp Bytes pg_temp_bytes Amount of data written temporarily to disk to execute queries (available in v. 9.2+) Count
PostgreSQL Tup Inserted pg_tup_inserted Rows inserted by queries (per database) Count
PostgreSQL Tup Updated pg_tup_updated Rows updated by queries (per database) Count
PostgreSQL Tup Deleted pg_tup_deleted Rows deleted by queries (per database) Count
PostgreSQL Tot Txns Executed pg_tot_txns_executed Total number of transactions executed (commits + rollbacks) Count
PostgreSQL Deadlocks pg_deadlocks Number of deadlocks detected in the database (v. 9.2+) Count
PostgreSQL Num Back Ends pg_numbackends Indicates the number of backends that are currently connected to the database. Count
PostgreSQL Blks Hit pg_blks_hit Number of times a requested block was found already in memory cache Count
PostgreSQL Blks Read pg_blks_read Number of disk blocks read from disk storage Count
PostgreSQL Locks Held pg_locks_held Locks currently held by transactions Count
PostgreSQL Locks Awaited pg_locks_awaited Locks awaited by transactions to acquire Count
PostgreSQL Checkpoints Req pg_checkpoints_req the number of requested checkpoints. Count
PostgreSQL Checkpoints Timed pg_checkpoints_timed the time spent for performing requested checkpoints. Count
PostgreSQL Buffers Checkpoints pg_buffers_checkpoint Number of buffers written during a checkpoint. Count
PostgreSQL Buffers Clean pg_buffers_clean Number of clean buffers in the buffer pool. Count
PostgreSQL Buffers Backend pg_buffers_backend Number of buffers used for backend I/O. Count
PostgreSQL Backend Connections Percent pg_max_conn_use_percent Indicates the number of active connections to the database. Percentage
PostgreSQL Heap Blks Hit pg_heap_blks_hit Blocks in the table that were shared buffer hits Count
PostgreSQL Heap Blks Read pg_heap_blks_read Blocks in the table that were read from disk Count
PostgreSQL Idx Blks Hit pg_idx_blks_hit Blocks from indexes in the table that were shared buffer hits Count
PostgreSQL Idx Blks Read pg_idx_blks_read Blocks from indexes in the table that were read from disk Count
PostgreSQL Table Size pg_table_size Disk space used by the table (excluding indexes) Bytes
PostgreSQL Indexes Size pg_indexes_size Disk space used by indexes in the table Bytes
PostgreSQL Idx Scan On Index pg_idx_scan_on_index Number of index scans initiated on the index Count
PostgreSQL Cl Waiting cl_waiting Client connections waiting on a server connection (PgBouncer) Count
PostgreSQL Max Wait maxwait Max time a client connection has been waiting to be served (PgBouncer) Seconds
PostgreSQL Query id pg_queryid Internal hash code computed from the statements parse tree Text
PostgreSQL Query pg_query Text of a representative statement Text
PostgreSQL Avg Time pg_avg_time The average time taken to complete an operation. Milliseconds
PostgreSQL Calls pg_calls The number of times a particular function or method is called. Count
PostgreSQL Total Time pg_total_time Total time spent in the statement Milliseconds
PostgreSQL Min Time pg_min_time Minimum time spent in the statement Milliseconds
PostgreSQL Max Time pg_max_time Maximum time spent in the statement Milliseconds
PostgreSQL Stddev Time pg_stddev_time Population standard deviation of time spent in the statement Milliseconds
PostgreSQL Rows pg_rows Total number of rows retrieved or affected by the statement Count
PostgreSQL Shared Blks Hit pg_shared_blks_hit Total number of shared block cache hits by the statement Count
PostgreSQL Shared Blks Read pg_shared_blks_read Total number of shared blocks read by the statement Count
PostgreSQL Shared Blks Dirtied pg_shared_blks_dirtied Total number of shared blocks dirtied by the statement Count
PostgreSQL Shared Blks Written pg_shared_blks_written Total number of shared blocks written by the statement Count
PostgreSQL Local Blks Hit pg_local_blks_hit Total number of local block cache hits by the statement Count
PostgreSQL Local Blks Read pg_local_blks_read Total number of local blocks read by the statement Count
PostgreSQL Local Blks Dirtied pg_local_blks_dirtied Total number of local blocks dirtied by the statement Count
PostgreSQL Local Blks Written pg_local_blks_written Total number of local blocks written by the statement Count
PostgreSQL Temp Blks Read pg_temp_blks_read Total number of temp blocks read by the statement Count
PostgreSQL PostgreSQL Temp Blks Written pg_temp_blks_written Total number of temp blocks written by the statement Count
PostgreSQL Blk Read Time pg_blk_read_time Time spent reading from disk storage Milliseconds
PostgreSQL Blk Write Time pg_blk_write_time Time spent writing to disk storage Milliseconds
PostgreSQL Component Properties Component_Properties The properties of a component such as its version and configuration. Text
PostgreSQL File Watch FILE_WATCH Monitors file changes in a directory or a specific file. Text
PostgreSQL Session Time session_time Time spent by database sessions in this database in milliseconds (note that statistics are only updated when the state of a session changes so if sessions have been idle for a long time, this idle time wont be included) Seconds
PostgreSQL Active Time active_time Time spent executing SQL statements in this database, in milliseconds (this corresponds to the states active ) Count
PostgreSQL Idle In Transaction_time idle_in_transaction_time Time spent idling while in a transaction in this database, in milliseconds (this corresponds to the states idle in transaction) Count
PostgreSQL Sessions sessions Total number of sessions established to this database. Count
PostgreSQL Sessions Abandoned sessions_abandoned Number of database sessions to this database that were terminated because connection to the client was lost. Count
PostgreSQL Sessions Fatal sessions_fatal Number of database sessions to this database that were terminated by fatal errors. Count
PostgreSQL Temp Files temp_files Number of temporary files created by queries in this database. All temporary files are counted, regardless of why the temporary file was created Count
PostgreSQL Heap Bulks Total Cluster heap_blks_total The total number of disk blocks in the table being clustered. Count
PostgreSQL Heap Bulks Scanned Cluster heap_blks_scanned The number of disk blocks already scanned in the table being clustered. Count
PostgreSQL Heap Bulks Total Vacuum cluster_heap_blks_total The total number of disk blocks in the table being vacuumed. Count
PostgreSQL Heap Bulks Scanned Vacuum cluster_heap_blks_scanned The number of disk blocks already scanned in the table being vacuumed. Count
PostgreSQL Num Dead Tuples num_dead_tuples The total number of dead tuples removed during the vacuum operation. Count
PostgreSQL Active Users pg_active_users Number of active users logged in database. Count
PostgreSQL Current Connections pg_current_connections PostgreSQL Current Connections Count
PostgreSQL Inactive Connections pg_inactive_connections PostgreSQL Inactive Connections Count
PostgreSQL Database Size pg_database_size_bytes PostgreSQL database size Bytes
PostgreSQL Replication pg_replication PostgreSQL replication Count
PostgreSQL In Bytes Replication Lag pg_replication_lag_bytes PostgreSQL replication lag in bytes Bytes
PostgreSQL In Seconds Replication Lag pg_replication_lag_seconds PostgreSQL replication lag in seconds Seconds
PostgreSQL Cache Size pg_effective_cache_size PostgreSQL Cache Size Bytes
PostgreSQL Work Memory pg_work_mem PostgreSQL Work Memory Bytes
PostgreSQL Commit Rollback pg_commit_rollback PostgreSQL Commit Rollback Bytes
PostgreSQL Heap Read pg_heap_read The number of heap blocks read from disk by the PostgreSQL database. This metric indicates the amount of data fetched from disk storage which can highlight disk I/O performance. Bytes
PostgreSQL Heap Hit pg_heap_hit The number of heap blocks served from the buffer cache rather than being read from disk. This metric shows how much of the data is being retrieved from memory. Bytes
PostgreSQL Cache Hit Rate pg_cache_hit_rate The percentage of total read requests that are served from the buffer cache. Percentage
PostgreSQL Global Locks pg_global_locks PostgreSQL Global Locks Count
PostgreSQL Blocked Sessions pg_blocked_sessions PostgreSQL Blocked Sessions Count
PostgreSQL Global Locks pg_pgd_workers PostgreSQL Commit Rollback Count
PostgreSQL Follower edb_raft_follower PostgreSQL Edb Raft Follower Count
PostgreSQL Leader edb_raft_leader PostgreSQL Edb Raft Leader Count
PostgreSQL Node Availability EDB_NODE_AVAILABILITY PostgreSQL Node Availability Count
PostgreSQL Cluster Availability EDB_CLUSTER_AVAILABILITY PostgreSQL Cluster Availability Count
PostgreSQL Read Write Ratio pg_read_write_ratio PostgreSQL Read Write Ratio Percentage
PostgreSQL Stat Activity pg_stat_activity PostgreSQL Database Stat Activity Count
PostgreSQL Index Usage pg_index_usage_percent PostgreSQL Index Usage Percentage
PostgreSQL Lock Waits pg_lock_waits PostgreSQL Lock Waits Count
PostgreSQL Replication Issues pg_replication_issues PostgreSQL Database replication issues Count
PostgreSQL Replication Delay pg_replication_delay PostgreSQL Database replication delay Count
PostgreSQL PG Versions pg_monitor_group_versions PostgreSQL Versions Count
PostgreSQL PG Node Summary pg_node_summary PostgreSQL Database Node Summary Count
PostgreSQL PG Version Mismatch pg_group_version_mismatch PostgreSQL Database Version Mismatch Count
PostgreSQL PG Camo Details pg_group_camo_details PostgreSQL Database Node Summary Count
PostgreSQL PG Node Replication Rates pg_node_replication_rates PostgreSQL Database Node Replication Rates Count
PostgreSQL PG Group Subscription Summary pg_group_subscription_summary PostgreSQL Database Group Subscription Summary Count
PostgreSQL PG Group Replslots Details pg_group_replslots_details PostgreSQL Database Replslots Details Count
PostgreSQL PG Group Raft Details pg_group_raft_details PostgreSQL Database Group Raft Details Count