Postgres integration metrics

The official Datadog integration for monitoring Postgres. It collects 244 metrics.

Official summary

Collect a wealth of database performance and health metrics.

Metric types

  • gauge (value at a point in time): 148
  • count (occurrences in the interval): 96

Metrics

Descriptions are the official definitions, unedited.

MetricTypeUnit
postgresql.active_queriesEnabled with collect_activity_metrics. The number of active queries in this database. This metric (by default) is tagged with db, app, user.gauge-
postgresql.active_waiting_queriesEnabled with collect_activity_metrics. The number of waiting queries in this database in state active. This metric (by default) is tagged with db, app, user.gauge-
postgresql.activity.backend_xid_ageThe age of the oldest backend's xid relative to latest stable xid. This metric (by default) is tagged with db, app, user.gaugetransaction
postgresql.activity.backend_xmin_ageThe age of the oldest backend's xmin horizon relative to latest stable xid. This metric (by default) is tagged with db, app, user.gaugetransaction
postgresql.activity.wait_eventThe number of wait events at the time of the check. This metric is tagged by user. This metric is tagged by user, db, app and backend_typegauge-
postgresql.activity.xact_start_ageThe age of the oldest active transactions. This metric (by default) is tagged with db, app, user.gaugesecond
postgresql.analyze.child_tables_doneNumber of child tables scanned. This counter only advances when the phase is acquiring inherited sample rows. This metric is tagged with db, table, child_relation, phase.gauge-
postgresql.analyze.child_tables_totalNumber of child tables. This metric is tagged with db, table, child_relation, phase.gauge-
postgresql.analyze.ext_stats_computedNumber of extended statistics computed. This counter only advances when the phase is computing extended statistics. This metric is tagged with db, table, child_relation, phase.gauge-
postgresql.analyze.ext_stats_totalNumber of extended statistics. This metric is tagged with db, table, child_relation, phase.gauge-
postgresql.analyze.sample_blks_scannedNumber of heap blocks scanned. This metric is tagged with db, table, child_relation, phase.gaugeblock
postgresql.analyze.sample_blks_totalTotal number of heap blocks that will be sampled. This metric is tagged with db, table, child_relation, phase.gaugeblock
postgresql.analyzedEnabled with relations. The number of times this table has been manually analyzed. This metric is tagged with db, schema, table.count-
postgresql.archiver.archived_countNumber of WAL files that have been successfully archived.count-
postgresql.archiver.failed_countNumber of failed attempts for archiving WAL files.count-
postgresql.autoanalyzedEnabled with relations. The number of times this table has been analyzed by the autovacuum daemon. This metric is tagged with db, schema, table.count-
postgresql.autovacuumedEnabled with relations. The number of times this table has been vacuumed by the autovacuum daemon. This metric is tagged with db, schema, table.count-
postgresql.before_xid_wraparoundThe number of transactions that can occur until a transaction wraparound. This metric is tagged with db.gaugetransaction
postgresql.bgwriter.buffers_allocThe number of buffers allocatedcount-
postgresql.bgwriter.buffers_backendThe number of buffers written directly by a backend.countbuffer
postgresql.bgwriter.buffers_backend_fsyncThe of times a backend had to execute its own fsync call instead of the background writer.count-
postgresql.bgwriter.buffers_checkpointThe number of buffers written during checkpoints.count-
postgresql.bgwriter.buffers_cleanThe number of buffers written by the background writer.count-
postgresql.bgwriter.checkpoints_requestedThe number of requested checkpoints that were performed.count-
postgresql.bgwriter.checkpoints_timedThe number of scheduled checkpoints that were performed.count-
postgresql.bgwriter.maxwritten_cleanThe number of times the background writer stopped a cleaning scan due to writing too many buffers.count-
postgresql.bgwriter.sync_timeThe total amount of checkpoint processing time spent synchronizing files to disk.countmillisecond
postgresql.bgwriter.write_timeThe total amount of checkpoint processing time spent writing files to disk.countmillisecond
postgresql.blk_read_timeTime spent reading data file blocks by backends in this database if track_io_timing is enabled. This metric is tagged with db.countmillisecond
postgresql.blk_write_timeTime spent writing data file blocks by backends in this database if track_io_timing is enabled. This metric is tagged with db.countmillisecond
postgresql.buffer_hitThe number of times disk blocks were found in the buffer cache, preventing the need to read from the database. This metric is tagged with db.gaugehit/second
postgresql.buffercache.dirty_buffersNumber of dirty shared buffers. pg_buffercache extension needs to be installed. This metric is tagged by db, schema and relation.gaugebuffer
postgresql.buffercache.pinning_backendsNumber of backends pinning shared buffers. pg_buffercache extension needs to be installed. This metric is tagged by db, schema and relation.gauge-
postgresql.buffercache.unused_buffersNumber of unused shared buffers. pg_buffercache extension needs to be installed.gaugebuffer
postgresql.buffercache.usage_countSum of shared buffers' usage_count. pg_buffercache extension needs to be installed. This metric is tagged by db, schema and relation.gauge-
postgresql.buffercache.used_buffersNumber of shared buffers. pg_buffercache extension needs to be installed. This metric is tagged by db, schema and relation.gaugebuffer
postgresql.checksums.checksum_failuresThe number of checksum failures in this database. This metric is tagged with db.count-
postgresql.checksums.enabledWhether database checksums are enabled. Value is always 1 and tagged with enabled:true or enabled:false. This metric is tagged with db.count-
postgresql.cluster_vacuum.heap_blks_scannedNumber of heap blocks scanned. This counter only advances when the phase is seq scanning heap. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, command, phase, index.gaugeblock
postgresql.cluster_vacuum.heap_blks_totalTotal number of heap blocks in the table. This number is reported as of the beginning of seq scanning heap. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, command, phase, index.gaugeblock
postgresql.cluster_vacuum.heap_tuples_scannedNumber of heap tuples scanned. This counter only advances when the phase is seq scanning heap, index scanning heap or writing new heap. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, command, phase, index.gauge-
postgresql.cluster_vacuum.heap_tuples_writtenNumber of heap tuples written. This counter only advances when the phase is seq scanning heap, index scanning heap or writing new heap. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, command, phase, index.gauge-
postgresql.cluster_vacuum.index_rebuild_countNumber of indexes rebuilt. This counter only advances when the phase is rebuilding index. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, command, phase, index.gauge-
postgresql.commitsThe number of transactions that have been committed in this database. This metric is tagged with db.gaugetransaction/second
postgresql.conflicts.bufferpinNumber of queries in this database that have been canceled due to pinned buffers. Buffer pin conflicts will occur when the walreceiver process tries to apply a buffer cleanup like HOT chain pruning. This require a complete lock of the buffer and any query pinning the buffer will conflict with the cleaning. This metric is tagged with db.countquery
postgresql.conflicts.deadlockNumber of queries in this database that have been canceled due to deadlocks. Deadlock conflicts will happen when the walreceiver tries to apply a buffer like HOT chain pruning. If the conflict takes more than deadlock_timeout seconds, a deadlock check will be triggered and conflicting queries will be canceled until the buffer is unpinned. This metric is tagged with db.countquery
postgresql.conflicts.lockNumber of queries in this database that have been canceled due to lock timeouts. This will occur when the walreceiver process tries to apply a change requiring an ACCESS EXCLUSIVE lock while a query on the replica is reading the table. The conflicting query will be killed after waiting up to max_standby_streaming_delay seconds. This metric is tagged with db.countquery
postgresql.conflicts.snapshotNumber of queries in this database that have been canceled due to old snapshots. Snapshot conflict will occur when a VACUUM is replayed, removing tuples currently read on a standby. This metric is tagged with db.countquery
postgresql.conflicts.tablespaceNumber of queries in this database that have been canceled due to dropped tablespaces. This will occur when a temp_tablespace is dropped while being used on a standby. This metric is tagged with db.countquery
postgresql.connectionsThe number of active connections to this database.gaugeconnection
postgresql.connections_by_processThe number of active connections to this database, broken down by process-level attributes. This metric is tagged with state, application, user, and db. (DBM only)gaugeconnection
postgresql.control.checkpoint_delayThe time since the last checkpoint.gaugesecond
postgresql.control.checkpoint_delay_bytesThe amount of WAL bytes written since the last checkpoint.gaugebyte
postgresql.control.redo_delay_bytesThe amount of WAL bytes written since the last redo point.gaugebyte
postgresql.control.timeline_idThe current timeline id.gauge-
postgresql.create_index.blocks_doneNumber of blocks already processed in the current phase. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, index, command, phase.gauge-
postgresql.create_index.blocks_totalTotal number of blocks to be processed in the current phase. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, index, command, phase.gauge-
postgresql.create_index.lockers_doneNumber of lockers already waited for. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, index, command, phase.gauge-
postgresql.create_index.lockers_totalTotal number of lockers to wait for, when applicable. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, index, command, phase.gauge-
postgresql.create_index.partitions_doneWhen creating an index on a partitioned table, this column is set to the number of partitions on which the index has been created. This field is 0 during a REINDEX. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, index, command, phase.gauge-
postgresql.create_index.partitions_totalWhen creating an index on a partitioned table, this column is set to the total number of partitions on which the index is to be created. This field is 0 during a REINDEX. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, index, command, phase.gauge-
postgresql.create_index.tuples_doneNumber of tuples already processed in the current phase. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, index, command, phase.gauge-
postgresql.create_index.tuples_totalTotal number of tuples to be processed in the current phase. Only available with PostgreSQL 12 and newer. This metric is tagged with db, table, index, command, phase.gauge-
postgresql.database_connectionsThe number of connections being made to this database instance as a fraction of the maximum number of allowed connections per logical database.gaugeconnection
postgresql.database_sizeThe disk space used by this database. This metric is tagged with db.gaugebyte
postgresql.db.countThe number of available databases.gaugeitem
postgresql.dead_rowsEnabled with relations. The estimated number of dead rows. This metric is tagged with db, schema, table.gaugerow
postgresql.deadlocksThe rate of deadlocks detected in this database. This metric is tagged with db.gaugelock/second
postgresql.deadlocks.countThe number of deadlocks detected in this database. This metric is tagged with db.countlock
postgresql.disk_readThe number of disk blocks read in this database. This metric is tagged with db.gaugeblock/second
postgresql.function.callsEnabled with collect_function_metrics. The number of calls made to a function. This metric is tagged with db, schema, function.gauge-
postgresql.function.self_timeEnabled with collect_function_metrics. Total time spent in this function itself, not including other functions called by it. This metric is tagged with db, schema, function.gauge-
postgresql.function.total_timeEnabled with collect_function_metrics. Total time spent in this function and all other functions called by it. This metric is tagged with db, schema, function.gauge-
postgresql.heap_blocks_hitEnabled with relations. The number of buffer hits in this table. This metric is tagged with db, schema, table.gaugehit/second
postgresql.heap_blocks_readEnabled with relations. The number of disk blocks read from this table. This metric is tagged with db, schema, table.gaugeblock/second
postgresql.index.index_blocks_hitEnabled with relations. The number of buffer hits for a specific index. This metric is tagged with db, schema, table, index.gaugehit/second
postgresql.index.index_blocks_readEnabled with relations. The number of disk blocks for a specific index. This metric is tagged with db, schema, table, index.gaugeblock/second
postgresql.index_bloatEnabled with collect_bloat_metrics. The estimated percentage of index bloat. This metric is tagged with db, schema, table, index.gaugepercent
postgresql.index_blocks_hitEnabled with relations. The number of buffer hits in all indexes on this table. This metric is tagged with db, schema, table.gaugehit/second
postgresql.index_blocks_readEnabled with relations. The number of disk blocks read from all indexes on this table. This metric is tagged with db, schema, table.gaugeblock/second
postgresql.index_rel_rows_fetchedEnabled with relations. The number of live rows fetched by index scans. This metric is tagged with db, schema, table.gaugerow/second
postgresql.index_rel_scansEnabled with relations. The overall number of index scans initiated on this table. This metric is tagged with db, schema, table.gaugescan/second
postgresql.index_rows_fetchedEnabled with relations. The number of live rows fetched by index scans. This metric is tagged with db, schema, table, index.gaugerow/second
postgresql.index_rows_readEnabled with relations. The number of index entries returned by scans on this index. This metric is tagged with db, schema, table, index.gaugerow/second
postgresql.index_scansEnabled with relations. The number of index scans initiated on this table. This metric is tagged with db, schema, table, indexgaugescan/second
postgresql.index_sizeEnabled with relations. The total disk space used by indexes attached to the specified table. This metric is tagged with db, schema, table.gaugebyte
postgresql.individual_index_sizeThe disk space used by a specified index. This metric is tagged with db, schema, table, index.gaugebyte
postgresql.io.evictionsThe number of times a block has been written out from a shared or local buffer in order to make it available for another use. This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)countmillisecond
postgresql.io.extend_timeThe time spent in extend operations (if track_io_timing is enabled, otherwise zero). This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)countmillisecond
postgresql.io.extendsThe number of relation extend operations. This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)count-
postgresql.io.fsync_timeThe time spent in fsync operations (if track_io_timing is enabled, otherwise zero). This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)countmillisecond
postgresql.io.fsyncsThe number of fsync calls. This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)count-
postgresql.io.hitsThe number of times a desired block was found in a shared buffer. This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)countmillisecond
postgresql.io.read_timeThe time spent in read operations (if track_io_timing is enabled, otherwise zero). This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)countmillisecond
postgresql.io.readsThe number of read operations. This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)count-
postgresql.io.write_timeThe time spent in write operations (if track_io_timing is enabled, otherwise zero). This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)countmillisecond
postgresql.io.writesThe number of write operations. This metric is tagged with backend_type, context, object. Only available with PostgreSQL 16 and newer. (DBM only)count-
postgresql.last_analyze_ageLast time at which this table was manually analyzed. This metric is tagged with db, schema, table.gaugesecond
postgresql.last_autoanalyze_ageLast time at which this table was analyzed by the autovacuum daemon. This metric is tagged with db, schema, table.gaugesecond
postgresql.last_autovacuum_ageLast time at which this table was vacuumed by the autovacuum daemon. This metric is tagged with db, schema, table.gaugesecond
postgresql.last_vacuum_ageLast time at which this table was manually vacuumed (not counting VACUUM FULL). This metric is tagged with db, schema, table.gaugesecond
postgresql.live_rowsEnabled with relations. The estimated number of live rows. This metric is tagged with db, schema, table.gaugerow
postgresql.locksEnabled with relations. The number of locks active for this database. This metric is tagged with db, lock_mode, lock_type, schema, table, granted.gaugelock
postgresql.locks.idle_in_transaction_ageTransaction age of idle in transaction sessions holding exclusive relation locks.gaugesecond
postgresql.max_connectionsThe maximum number of client connections allowed to this database.gaugeconnection
postgresql.percent_database_usage_connectionsThe number of connections being made to this database as a fraction of the maximum number of allowed connections per logical databasegaugefraction
postgresql.percent_usage_connectionsThe number of connections to this database as a fraction of the maximum number of allowed connections.gaugefraction
postgresql.pg_stat_statements.deallocThe number of times pg_stat_statements had to evict least executed queries because pg_stat_statements.max was reached.count-
postgresql.queries.blk_read_timeTotal time spent reading blocks per query_signature, db, and user. (DBM only)countnanosecond
postgresql.queries.blk_write_timeTotal time spent writing blocks per query_signature, db, and user. (DBM only)countnanosecond
postgresql.queries.countThe total query execution count per query_signature, db, and user. (DBM only)countquery
postgresql.queries.duration.maxThe age of the longest executed query per user, db and app. (DBM only)gaugenanosecond
postgresql.queries.duration.sumThe sum of the age of all executed queries per user, db and app. (DBM only)gaugenanosecond
postgresql.queries.local_blks_dirtiedTotal number of local blocks dirtied per query_signature, db, and user. (DBM only)countblock
postgresql.queries.local_blks_hitTotal number of local block cache hits per query_signature, db, and user. (DBM only)countblock
postgresql.queries.local_blks_readTotal number of local blocks read per query_signature, db, and user. (DBM only)countblock
postgresql.queries.local_blks_writtenTotal number of local blocks written per query_signature, db, and user. (DBM only)countblock
postgresql.queries.rowsThe total number of rows retrieved or affected per query_signature, db, and user. (DBM only)countrow
postgresql.queries.shared_blks_dirtiedTotal number of shared blocks dirtied per query_signature, db, and user. (DBM only)countblock
postgresql.queries.shared_blks_hitTotal number of shared block cache hits per query_signature, db, and user. (DBM only)countblock
postgresql.queries.shared_blks_readTotal number of shared blocks read per query_signature, db, and user. (DBM only)countblock
postgresql.queries.shared_blks_writtenTotal number of shared blocks written per query_signature, db, and user. (DBM only)countblock
postgresql.queries.temp_blks_readTotal number of temp blocks read per query_signature, db, and user. (DBM only)countblock
postgresql.queries.temp_blks_writtenTotal number of temp blocks written per query_signature, db, and user. (DBM only)countblock
postgresql.queries.timeThe total query execution time per query_signature, db, and user. (DBM only)countnanosecond
postgresql.recovery_prefetch.block_distanceHow many blocks ahead the prefetcher is looking.gaugeblock
postgresql.recovery_prefetch.hitNumber of blocks not prefetched because they were already in the buffer pool.countblock
postgresql.recovery_prefetch.io_depthHow many prefetches have been initiated but are not yet known to have completed.gauge-
postgresql.recovery_prefetch.prefetchNumber of blocks prefetched because they were not in the buffer pool.countblock
postgresql.recovery_prefetch.skip_fpwNumber of blocks not prefetched because a full page image was included in the WAL.countblock
postgresql.recovery_prefetch.skip_initNumber of blocks not prefetched because they would be zero-initialized.countblock
postgresql.recovery_prefetch.skip_newNumber of blocks not prefetched because they didn't exist yet.countblock
postgresql.recovery_prefetch.skip_repNumber of blocks not prefetched because they were already recently prefetched.countblock
postgresql.recovery_prefetch.wal_distanceHow many bytes ahead the prefetcher is looking.gaugebyte
postgresql.relation.all_visibleNumber of pages that are marked as all visible in the table's visibility map. This is only an estimation used by the planner and is updated by VACUUM or ANALYZE. This metric is tagged with db, schema, table, partition_ofgauge-
postgresql.relation.pagesSize of a table in pages (1 page == 8KB by default). This is only an estimation used by the planner and is updated by VACUUM or ANALYZE. This metric is tagged with db, schema, table, partition_of.gauge-
postgresql.relation.tuplesNumber of live rows in the table. This is only an estimation used by the planner and is updated by VACUUM or ANALYZE. If the table has never been vacuumed or analyze, -1 will be reported. This metric is tagged with db, schema, table, partition_ofgauge-
postgresql.relation.xminTransaction ID of the latest relation's modification in pg_class. This metric is tagged with db, schema, tablegauge-
postgresql.relation_sizeThe disk space used by the specified table. TOAST data, indexes, free space map and visibility map are not included. This metric is tagged with db, schema, table.gaugebyte
postgresql.replication.backend_xmin_ageThe age of the standby server's xmin horizon (relative to latest stable xid) reported by hot_standby_feedback.gauge-
postgresql.replication.flush_lsn_delayThe delay in bytes between the current WAL position and the last location flushed by the standby servergaugebyte
postgresql.replication.replay_lsn_delayThe delay in bytes between the current WAL position and the last location replayed by the standby servergaugebyte
postgresql.replication.sent_lsn_delayThe delay in bytes between the current WAL position and the last location sent by the standby servergaugebyte
postgresql.replication.wal_flush_lagTime elapsed between flushing recent WAL locally and receiving notification that this standby server has written and flushed it (but not yet applied it). This can be used to gauge the delay that synchronous_commit level on incurred while committing if this server was configured as a synchronous standby. Only available with postgresql 10 and newer.gaugesecond
postgresql.replication.wal_replay_lagTime elapsed between flushing recent WAL locally and receiving notification that this standby server has written, flushed and applied it. This can be used to gauge the delay that synchronous_commit level remote_apply incurred while committing if this server was configured as a synchronous standby. Only available with postgresql 10 and newer.gaugesecond
postgresql.replication.wal_write_lagTime elapsed between flushing recent WAL locally and receiving notification that this standby server has written it (but not yet flushed it or applied it). This can be used to gauge the delay that synchronous_commit level remote_write incurred while committing if this server was configured as a synchronous standby. Only available with postgresql 10 and newer.gaugesecond
postgresql.replication.write_lsn_delayThe delay in bytes between the current WAL position and the last location written by the standby servergaugebyte
postgresql.replication_delayThe current replication delay in seconds. Only available with postgresql 9.1 and newergaugesecond
postgresql.replication_delay_bytesThe current replication delay in bytes. Only available with postgresql 9.2 and newergaugebyte
postgresql.replication_slot.catalog_xmin_ageThe age of the oldest transaction affecting the system catalogs that this slot needs the database to retain. VACUUM cannot remove catalog tuples deleted by any later transaction. This metric is tagged with slot_name, slot_type, slot_persistence, slot_state.gaugetransaction
postgresql.replication_slot.confirmed_flush_delay_bytesThe delay in bytes between the current WAL position and last position this slot's consumer confirmed. This is only available for logical replication slots. This metric is tagged with slot_name, slot_type, slot_persistence, slot_state.gaugebyte
postgresql.replication_slot.restart_delay_bytesThe amount of WAL bytes that the consumer of this slot may require and won't be automatically removed during checkpoints unless it exceeds max_slot_wal_keep_size parameter. Nothing is reported if there's no WAL reservation for this slot. This metric is tagged with slot_name, slot_type, slot_persistence, slot_state.gaugebyte
postgresql.replication_slot.spill_bytesAmount of decoded transaction data spilled to disk while performing decoding of changes from WAL for this slot. This and other spill counters can be used to gauge the I/O occurred during logical decoding and allow tuning logical_decoding_work_mem. Extracted from pg_stat_replication_slots. Only available with PostgreSQL 14 and newer. This metric is tagged with slot_name, slot_type, slot_state.countbyte
postgresql.replication_slot.spill_countNumber of times transactions were spilled to disk while decoding changes from WAL for this slot. This counter is incremented each time a transaction is spilled, and the same transaction may be spilled multiple times. Extracted from pg_stat_replication_slots. Only available with PostgreSQL 14 and newer. This metric is tagged with slot_name, slot_type, slot_state.count-
postgresql.replication_slot.spill_txnsNumber of transactions spilled to disk once the memory used by logical decoding to decode changes from WAL has exceeded logical_decoding_work_mem. The counter gets incremented for both top-level transactions and subtransactions. Extracted from pg_stat_replication_slots. Only available with PostgreSQL 14 and newer. This metric is tagged with slot_name, slot_type, slot_state.counttransaction
postgresql.replication_slot.stream_bytesAmount of transaction data decoded for streaming in-progress transactions to the decoding output plugin while decoding changes from WAL for this slot. Extracted from pg_stat_replication_slots. Only available with PostgreSQL 14 and newer. This metric is tagged with slot_name, slot_type, slot_state.countbyte
postgresql.replication_slot.stream_countNumber of times in-progress transactions were streamed to the decoding output plugin while decoding changes from WAL for this slot. Extracted from pg_stat_replication_slots. Only available with PostgreSQL 14 and newer. This metric is tagged with slot_name, slot_type, slot_state.count-
postgresql.replication_slot.stream_txnsNumber of in-progress transactions streamed to the decoding output plugin after the memory used by logical decoding to decode changes from WAL for this slot has exceeded logical_decoding_work_mem. Extracted from pg_stat_replication_slots. Only available with PostgreSQL 14 and newer. This metric is tagged with slot_name, slot_type, slot_state.counttransaction
postgresql.replication_slot.total_bytesAmount of transaction data decoded for sending transactions to the decoding output plugin while decoding changes from WAL for this slot. Extracted from pg_stat_replication_slots. Only available with PostgreSQL 14 and newer. This metric is tagged with slot_name, slot_type, slot_state.countbyte
postgresql.replication_slot.total_txnsNumber of decoded transactions sent to the decoding output plugin for this slot. Extracted from pg_stat_replication_slots. Only available with PostgreSQL 14 and newer. This metric is tagged with slot_name, slot_type, slot_state.counttransaction
postgresql.replication_slot.xmin_ageThe age of the oldest transaction that this slot needs the database to retain. Only physical replication slot will have a xmin. Orphaned replication slot (no consumer or consumer is not connected) will prevent the xmin horizon from progressing. This metric is tagged with slot_name, slot_type, slot_persistence, slot_state.gaugetransaction
postgresql.rollbacksThe number of transactions that have been rolled back in this database. This metric is tagged with db.gaugetransaction/second
postgresql.rows_deletedEnabled with relations. The number of rows deleted by queries in this database. This metric is tagged with db.gaugerow/second
postgresql.rows_fetchedThe number of rows fetched by queries in this database. This metric is tagged with db.gaugerow/second
postgresql.rows_hot_updatedEnabled with relations. The number of rows HOT updated, meaning no separate index update was needed. This metric is tagged with db, schema, table.gaugerow/second
postgresql.rows_insertedEnabled with relations. The number of rows inserted by queries in this database. This metric is tagged with db.gaugerow/second
postgresql.rows_returnedThe number of rows returned by queries in this database. This metric is tagged with db.gaugerow/second
postgresql.rows_updatedEnabled with relations. The number of rows updated by queries in this database. This metric is tagged with db.gaugerow/second
postgresql.runningThe number of instances running.gauge-
postgresql.seq_rows_readEnabled with relations. The number of live rows fetched by sequential scans. This metric is tagged with db, schema, table.gaugerow/second
postgresql.seq_scansEnabled with relations. The number of sequential scans initiated on this table. This metric is tagged with db, schema, table.gaugescan/second
postgresql.sessions.abandonedNumber of database sessions to this database that were terminated because connection to the client was lost. This metric is tagged with db.countsession
postgresql.sessions.active_timeTime spent executing SQL statements in this database, in milliseconds (this corresponds to the states active and fastpath function call in pg_stat_activity). This metric is tagged with db.countmillisecond
postgresql.sessions.countTotal number of sessions established to this database. This metric is tagged with db.countsession
postgresql.sessions.fatalNumber of database sessions to this database that were terminated by fatal errors. This metric is tagged with db.countsession
postgresql.sessions.idle_in_transaction_timeCumulative time that sessions spent idling while in a transaction in this database, in milliseconds (this corresponds to the states idle in transaction and idle in transaction (aborted) in pg_stat_activity). This metric is tagged with db.countmillisecond
postgresql.sessions.killedNumber of database sessions to this database that were terminated by operator intervention. This metric is tagged with db.countsession
postgresql.sessions.session_timeTime 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 won't be included). This metric is tagged with db.countmillisecond
postgresql.slru.blks_existsNumber of blocks checked for existence for SLRU (simple least-recently-used) cache. Only CommitTs and MultiXactOffset caches are checking if blocks are already present on disk. This metric is tagged with slru_name.countblock
postgresql.slru.blks_hitNumber of times disk blocks were found already in the SLRU (simple least-recently-used), so that a read was not necessary (this only includes hits in the SLRU, not the operating system's file system cache). This metric is tagged with slru_name.countblock
postgresql.slru.blks_readNumber of disk blocks read for SLRU (simple least-recently-used) cache. SLRU caches are created with a fixed number of pages. When all pages are used, the least recently used block is dumped on disk to create space. Access to the evicted block will require data to be read from the disk and loaded back in an SLRU cache page, increasing the block read count. This metric is tagged with slru_name.countblock
postgresql.slru.blks_writtenNumber of disk blocks written for SLRU (simple least-recently-used) cache. SLRU caches are created with a fixed number of pages. When all pages are used, the least recently used block is dumped on disk to create space. A block eviction doesn't necessarily generate disk write as the block could have been written in a previous eviction. This metric is tagged with slru_name.countblock
postgresql.slru.blks_zeroedNumber of blocks zeroed during initializations of SLRU (simple least-recently-used) cache. SLRU caches are created with a fixed number of pages. For Subtrans, Xact and CommitTs caches, the global transactionId is used to get the page number. Thus, it will increase with the transaction throughput. This metric is tagged with slru_name.countblock
postgresql.slru.flushesNumber of flush of dirty data for SLRU (simple least-recently-used) cache. CommitTs, MultiXact, Subtrans, Xact caches flush will happen during checkpoint. MultiXact cache flush may happen during vacuum. This metric is tagged with slru_name.count-
postgresql.slru.truncatesNumber of truncates for SLRU (simple least-recently-used) cache. For CommitTs, Xact and MultiXact, truncates will happen when the frozenID progresses. For Subtrans, a truncate can occur during restartpoint and a checkpoint. This metric is tagged with slru_name.count-
postgresql.snapshot.xip_countReport the number of active transactions based on pg_snapshot_xip(pg_current_snapshot()).gauge-
postgresql.snapshot.xmaxReport the next transaction ID that will be assigned based on pg_snapshot_xmax(pg_current_snapshot()).gauge-
postgresql.snapshot.xminReport the lowest transaction ID still active based on pg_snapshot_xmin(pg_current_snapshot()). All transaction IDs less than xmin are either committed and visible, or rolled back and dead.gauge-
postgresql.subscription.apply_errorNumber of errors that occurred while applying changes. Extracted from pg_stat_subscription_stats. Only available on PostgreSQL 15 or higher. This metric is tagged with subscription_name.count-
postgresql.subscription.last_msg_receipt_ageAge of receipt time of the last message received from origin WAL sender. Extracted from pg_stat_subscription. Only available on PostgreSQL 12 or higher. This metric is tagged with subscription_name.gaugesecond
postgresql.subscription.last_msg_send_ageAge of last message received from origin WAL sender. Extracted from pg_stat_subscription. Only available on PostgreSQL 12 or higher. This metric is tagged with subscription_name.gaugesecond
postgresql.subscription.latest_end_ageAge of last write-ahead log location reported to origin WAL sender. Extracted from pg_stat_subscription. Only available on PostgreSQL 12 or higher. This metric is tagged with subscription_name.gaugesecond
postgresql.subscription.stateState of a subscription per relation and subscription. Extracted from pg_subscription_rel. Only available on PostgreSQL 14 or higher. This metric is tagged with subscription_name, relation, state.gauge-
postgresql.subscription.sync_errorNumber of errors that occurred during the initial table synchronization. Extracted from pg_stat_subscription_stats. Only available on PostgreSQL 15 or higher. This metric is tagged with subscription_name.count-
postgresql.table.countThe number of user tables in this database. This metric is tagged with db, schema.gaugetable
postgresql.table_bloatEnabled with collect_bloat_metrics. The estimated percentage of table bloat. This metric is tagged with db, schema, table.gaugepercent
postgresql.table_sizeEnabled with relations. The disk space used by the specified table with TOAST data. Free space map and visibility map are not included. This metric is tagged with db, schema, table.gaugebyte
postgresql.temp_bytesThe amount of data written to temporary files by queries in this database. This metric is tagged with db.gaugebyte/second
postgresql.temp_filesThe number of temporary files created by queries in this database. This metric is tagged with db.gaugefile/second
postgresql.toast.autovacuumedEnabled with relations. The number of times the toast table of a relation has been autovacuumed. This metric is tagged with db, schema, table.count-
postgresql.toast.dead_rowsEnabled with relations. The number of dead rows on the toast table of a relation. This metric is tagged with db, schema, table.gauge-
postgresql.toast.index_scansEnabled with relations. The number of index scans done on the toast table of a relation. This metric is tagged with db, schema, table.count-
postgresql.toast.last_autovacuum_ageLast time at which the toast table of this table was vacuumed by the autovacuum daemon. This metric is tagged with db, schema, table.gaugesecond
postgresql.toast.last_vacuum_ageLast time at which the toast table of this table was manually vacuumed (not counting VACUUM FULL). This metric is tagged with db, schema, table.gaugesecond
postgresql.toast.live_rowsEnabled with relations. The number of live rows on the toast table of a relation. This metric is tagged with db, schema, table.gauge-
postgresql.toast.rows_deletedEnabled with relations. The number of deleted rows on the toast table of a relation. This metric is tagged with db, schema, table.count-
postgresql.toast.rows_fetchedEnabled with relations. The number of fetched rows on the toast table of a relation. This metric is tagged with db, schema, table.count-
postgresql.toast.rows_insertedEnabled with relations. The number of inserted rows on the toast table of a relation. This metric is tagged with db, schema, table.count-
postgresql.toast.vacuumedEnabled with relations. The number times the toast table of a relation has been vacuumed. This metric is tagged with db, schema, table.count-
postgresql.toast_blocks_hitEnabled with relations. The number of buffer hits in this table's TOAST table. This metric is tagged with db, schema, table.gaugehit/second
postgresql.toast_blocks_readEnabled with relations. The number of disk blocks read from this table's TOAST table. This metric is tagged with db, schema, table.gaugeblock/second
postgresql.toast_index_blocks_hitEnabled with relations. The number of buffer hits in this table's TOAST table index. This metric is tagged with db, schema, table.gaugeblock/second
postgresql.toast_index_blocks_readEnabled with relations. The number of disk blocks read from this table's TOAST table index. This metric is tagged with db, schema, table.gaugeblock/second
postgresql.toast_sizeThe total disk space used by the toast table attached to the specified table. This metric is tagged with db, schema, table.gaugebyte
postgresql.total_sizeEnabled with relations. The total disk space used by the table, including indexes and TOAST data. This metric is tagged with db, schema, table.gaugebyte
postgresql.transactions.duration.maxThe age of the longest running transaction per user, db and app. (DBM only)gaugenanosecond
postgresql.transactions.duration.sumThe sum of the age of all running transactions per user, db and app. (DBM only)gaugenanosecond
postgresql.transactions.idle_in_transactionEnabled with collect_activity_metrics. The number of 'idle in transaction' transactions in this database. This metric (by default) is tagged with db, app, user.gaugetransaction
postgresql.transactions.openEnabled with collect_activity_metrics. The number of open transactions in this database. This metric (by default) is tagged with db, app, user.gaugetransaction
postgresql.uptimeThe uptime of the server in seconds.gaugesecond
postgresql.vacuum.heap_blks_scannedNumber of heap blocks scanned. Because the visibility map is used to optimize scans, some blocks will be skipped without inspection; skipped blocks are included in this total, so that this number will eventually become equal to heap_blks_total when the vacuum is complete. This counter only advances when the phase is scanning heap. This metric is tagged with db, table, phase.gaugeblock
postgresql.vacuum.heap_blks_totalTotal number of heap blocks in the table. This number is reported as of the beginning of the scan; blocks added later will not be (and need not be) visited by this VACUUM. This metric is tagged with db, table, phase.gaugeblock
postgresql.vacuum.heap_blks_vacuumedNumber of heap blocks vacuumed. Unless the table has no indexes, this counter only advances when the phase is vacuuming heap. Blocks that contain no dead tuples are skipped, so the counter may sometimes skip forward in large increments. This metric is tagged with db, table, phase.gaugeblock
postgresql.vacuum.index_vacuum_countNumber of completed index vacuum cycles. This metric is tagged with db, table, phase.gaugeblock
postgresql.vacuum.max_dead_tuplesNumber of dead tuples that we can store before needing to perform an index vacuum cycle, based on maintenance_work_mem. This metric is tagged with db, table, phase.gauge-
postgresql.vacuum.num_dead_tuplesNumber of dead tuples collected since the last index vacuum cycle. This metric is tagged with db, table, phase.gauge-
postgresql.vacuumedEnabled with relations. The number of times this table has been manually vacuumed. This metric is tagged with db, schema, table.count-
postgresql.waiting_queriesEnabled with collect_activity_metrics. The number of waiting queries in this database. This metric (by default) is tagged with db, app, user.gauge-
postgresql.wal.buffers_fullNumber of times WAL data was written to disk because WAL buffers became full. WAL changes are stored in WAL buffers first. If the buffer is full, WAL insertions will be blocked until buffer is flushed. The size of this buffer is set by wal_buffers configuration. By default, it will use 3% of the shared_buffers value.count-
postgresql.wal.bytesTotal amount of WAL generated in bytes.countbyte
postgresql.wal.full_page_imagesTotal number of WAL full page images generated. Full page write will happen when a block is modified for the first time after a checkpoint.countpage
postgresql.wal.recordsTotal number of WAL records generated.countrecord
postgresql.wal.syncNumber of times WAL files were synced to disk.count-
postgresql.wal.sync_timeTotal amount of time spent syncing WAL files to disk, in milliseconds (if track_wal_io_timing is enabled, fsync is on, and wal_sync_method is either fdatasync, fsync or fsync_writethrough, otherwise zero).countmillisecond
postgresql.wal.writeNumber of times WAL buffers were written out to disk.countwrite
postgresql.wal.write_timeTotal amount of time spent writing WAL buffers to disk, in milliseconds (if track_wal_io_timing is enabled, otherwise zero).countmillisecond
postgresql.wal_ageEnabled with collect_wal_metrics. The age in seconds of the oldest WAL file.gaugesecond
postgresql.wal_countThe number WAL files on disk.gauge-
postgresql.wal_receiver.connectedThe status of the WAL receiver. This metric will be set to 1 with a 'status:disconnected' tag if the instance doesn't have a running WAL receiver. Otherwise it will use status value from pg_stat_wal_receiver. This metric is tagged with status.gauge-
postgresql.wal_receiver.last_msg_receipt_ageTime since the reception of the last message from the WAL sender. This metric is tagged with status.gaugesecond
postgresql.wal_receiver.last_msg_send_ageThe age of the latest message's send time received from the WAL sender. This metric is tagged with status.gaugesecond
postgresql.wal_receiver.latest_end_ageTime since the reception of the last message from the WAL sender with an WAL location update. This metric is tagged with status.gaugesecond
postgresql.wal_receiver.received_timelineTimeline number of last write-ahead log location received and flushed to disk, the initial value of this field being the timeline number of the first log location used when WAL receiver is started. This metric is tagged with status.gauge-
postgresql.wal_sizeThe sum of all WAL files on disk.gaugebyte

Official documentation

Official documentation for the Postgres integration

Metric names and descriptions are the official Datadog integration definitions (Copyright Datadog, Inc., BSD-3-Clause), reproduced unedited. The full license terms are on the About page.