PostgreSQL Cluster in ObserveOps
Overview
The PostgreSQL Cluster integration gives ObserveOps deep visibility into cluster health across primary and standby nodes, replication state, WAL activity, archive progress, checkpoints, buffer and connection usage, long-running transactions, and per-node recovery state. Use it to track replication lag, slot retention, archiver failures, and backend saturation on each node in the cluster.
Prerequisites
- The PostgreSQL cluster is reachable from the ObserveOps server on the configured port (default
5432). - A monitoring role with permission to read
pg_stat_*views, replication, archiver, and WAL metadata on every node. pg_hba.confallows the ObserveOps server IP for the monitoring role.postgresql.confhaslisten_addressesset to accept connections from the ObserveOps server.- Each node in the cluster is discovered as a monitor before cluster metrics are available.
List of Supported KPIs
| Metric | Description | Type |
|---|---|---|
| postgresql.cluster.system.identifier | Unique system identifier of the PostgreSQL cluster | String |
| postgresql.cluster.version | PostgreSQL version running on the cluster | String |
| postgresql.cluster.primary.node | Primary node of the cluster | String |
| postgresql.cluster.node | Current node identifier | String |
| postgresql.cluster.nodes | Total number of nodes in the cluster | Count |
| postgresql.cluster.node.role | Role of the node (primary, standby) | String |
| postgresql.cluster.node.upstream | Upstream node this node replicates from | String |
| postgresql.cluster.state | Current state of the cluster | String |
| postgresql.cluster.timeline | Current timeline identifier of the cluster | Count |
| postgresql.cluster.uptime.seconds | Uptime of the cluster in seconds | Count |
| postgresql.cluster.reachable.nodes | Number of nodes reachable from the primary | Count |
| postgresql.cluster.unreachable.nodes | Number of nodes unreachable from the primary | Count |
| postgresql.cluster.standbys | Total number of standby nodes | Count |
| postgresql.cluster.sync.standbys | Number of synchronous standby nodes | Count |
| postgresql.cluster.replication | Replication status of the cluster | String |
| postgresql.cluster.replication.standby.name | Name of the standby in a replication connection | String |
| postgresql.cluster.replication.standby.client | Client address of the standby | String |
| postgresql.cluster.replication.standby.state | Current state of the standby replication | String |
| postgresql.cluster.replication.standby.sync.state | Synchronisation state of the standby | String |
| postgresql.cluster.replication.standby.sent.lag.bytes | Bytes sent but not yet acknowledged by the standby | Count |
| postgresql.cluster.replication.standby.write.lag.bytes | Bytes written on primary but not yet written on the standby | Count |
| postgresql.cluster.replication.standby.flush.lag.bytes | Bytes written but not yet flushed to disk on the standby | Count |
| postgresql.cluster.replication.standby.replay.lag.bytes | Bytes flushed but not yet replayed on the standby | Count |
| postgresql.cluster.replication.standby.write.lag.seconds | Write lag on the standby in seconds | Count |
| postgresql.cluster.replication.standby.flush.lag.seconds | Flush lag on the standby in seconds | Count |
| postgresql.cluster.replication.standby.replay.lag.seconds | Replay lag on the standby in seconds | Count |
| postgresql.cluster.replication.sent.lag.bytes | Aggregate replication sent lag across all standbys in bytes | Count |
| postgresql.cluster.replication.write.lag.bytes | Aggregate replication write lag across all standbys in bytes | Count |
| postgresql.cluster.replication.flush.lag.bytes | Aggregate replication flush lag across all standbys in bytes | Count |
| postgresql.cluster.replication.replay.lag.bytes | Aggregate replication replay lag across all standbys in bytes | Count |
| postgresql.cluster.replication.write.lag.seconds | Aggregate replication write lag in seconds | Count |
| postgresql.cluster.replication.flush.lag.seconds | Aggregate replication flush lag in seconds | Count |
| postgresql.cluster.replication.replay.lag.seconds | Aggregate replication replay lag in seconds | Count |
| postgresql.cluster.wal.sender.state | State of the WAL sender process | String |
| postgresql.cluster.replication.slots | Total number of replication slots | Count |
| postgresql.cluster.inactive.replication.slots | Number of inactive replication slots | Count |
| postgresql.cluster.replication.slot.retained.wal.bytes | WAL bytes retained by a replication slot | Count |
| postgresql.cluster.lost.replication.slots | Number of replication slots in a lost state | Count |
| postgresql.cluster.maximum.wal.senders | Maximum WAL sender processes allowed | Count |
| postgresql.cluster.maximum.replication.slots | Maximum replication slots allowed | Count |
| postgresql.cluster.synchronous.standby.names | List of synchronous standby names configured | String |
| postgresql.cluster.auto.vacuum.workers | Active autovacuum workers | Count |
| postgresql.cluster.maximum.auto.vacuum.workers | Maximum autovacuum workers allowed | Count |
| postgresql.cluster.pending.archives | WAL files pending to be archived | Count |
| postgresql.cluster.wal.bytes.rate | Rate of WAL bytes generated per second | Count |
| postgresql.cluster.wal.files | Number of WAL files in the WAL directory | Count |
| postgresql.cluster.wal.directory.bytes | Total size of the WAL directory in bytes | Count |
| postgresql.cluster.maximum.wal.size.bytes | Configured maximum WAL size in bytes | Count |
| postgresql.cluster.archives | Count of WAL files successfully archived | Count |
| postgresql.cluster.failed.archives | Count of WAL files that failed to archive | Count |
| postgresql.cluster.archiver.state | Current state of the WAL archiver | String |
| postgresql.cluster.backup.state | Current state of the cluster backup | String |
| postgresql.cluster.last.archived.wal | Name of the last successfully archived WAL file | String |
| postgresql.cluster.last.archived.time | Timestamp of the last successful archive | String |
| postgresql.cluster.last.failed.wal | Name of the last WAL file that failed to archive | String |
| postgresql.cluster.last.failed.time | Timestamp of the last archive failure | String |
| postgresql.cluster.last.archive.age.seconds | Age of the last archive in seconds | Count |
| postgresql.cluster.scheduled.checkpoints | Count of scheduled checkpoints executed | Count |
| postgresql.cluster.requested.checkpoints | Count of requested checkpoints executed | Count |
| postgresql.cluster.checkpoint.write.time.ms | Time spent writing checkpoints in milliseconds | Count |
| postgresql.cluster.checkpoint.sync.time.ms | Time spent syncing checkpoints in milliseconds | Count |
| postgresql.cluster.checkpoint.buffers | Buffers written during checkpoints | Count |
| postgresql.cluster.clean.buffers | Clean buffers available in the buffer pool | Count |
| postgresql.cluster.max.clean.buffers | Maximum clean buffers configured | Count |
| postgresql.cluster.backend.buffers | Buffers written by backends | Count |
| postgresql.cluster.backend.fsync.buffers | Buffers fsynced by backends | Count |
| postgresql.cluster.allocated.buffers | Total buffers allocated | Count |
| postgresql.cluster.maximum.connections | Maximum connections allowed on the cluster | Count |
| postgresql.cluster.connections | Current number of open connections | Count |
| postgresql.cluster.connection.used.percent | Percentage of connections in use | Count |
| postgresql.cluster.active.sessions | Count of sessions currently executing a query | Count |
| postgresql.cluster.idle.sessions | Count of idle sessions | Count |
| postgresql.cluster.idle.in.transaction.sessions | Count of sessions idle in a transaction | Count |
| postgresql.cluster.waiting.sessions | Count of sessions waiting on a lock or resource | Count |
| postgresql.cluster.longest.transaction.seconds | Duration of the longest running transaction in seconds | Count |
| postgresql.cluster.prepared.transactions | Count of currently prepared transactions | Count |
| postgresql.cluster.transaction.id.age | Age of the oldest transaction ID in the cluster | Count |
| postgresql.cluster.multixact.id.age | Age of the oldest multixact ID in the cluster | Count |
| postgresql.cluster.transaction.id.used.percent | Percentage of the transaction ID space consumed | Count |
| postgresql.cluster.commits.rate | Rate of transaction commits per second | Count |
| postgresql.cluster.rollbacks.rate | Rate of transaction rollbacks per second | Count |
| postgresql.cluster.deadlocks | Count of deadlocks detected | Count |
| postgresql.cluster.temporary.files | Count of temporary files created | Count |
| postgresql.cluster.temporary.bytes | Total bytes written to temporary files | Count |
| postgresql.cluster.block.hits.rate | Rate of block hits in the buffer cache | Count |
| postgresql.cluster.block.reads.rate | Rate of block reads from disk | Count |
| postgresql.cluster.cache.hit.ratio.percent | Buffer cache hit ratio as a percentage | Count |
| postgresql.cluster.checksum.failures | Count of data checksum failures detected | Count |
| postgresql.cluster.recovery.conflicts | Count of recovery conflicts on standby nodes | Count |
| postgresql.cluster.data.directory | Path to the PostgreSQL data directory | String |
| postgresql.cluster.auto.vacuum | Autovacuum configuration setting | String |
| postgresql.cluster.data.checksums | Whether data checksums are enabled | String |
| postgresql.cluster.shared.buffer.bytes | Size of shared buffers in bytes | Count |
| postgresql.cluster.wal.buffer.bytes | Size of WAL buffers in bytes | Count |
| postgresql.cluster.effective.cache.size.bytes | Effective cache size configuration in bytes | Count |
| postgresql.cluster.work.memory.bytes | Work memory setting in bytes | Count |
| postgresql.cluster.maintenance.work.memory.bytes | Maintenance work memory setting in bytes | Count |
| postgresql.cluster.node.state | Current state of the node | String |
| postgresql.cluster.node.version | PostgreSQL version running on the node | String |
| postgresql.cluster.node.timeline | Timeline the node is currently on | Count |
| postgresql.cluster.node.lag.bytes | Replication lag for the node in bytes | Count |
| postgresql.cluster.node.lag.seconds | Replication lag for the node in seconds | Count |
| postgresql.cluster.node.connections | Current open connections on the node | Count |
| postgresql.cluster.node.uptime.seconds | Uptime of the node in seconds | Count |
| postgresql.cluster.node.wal.receiver.state | State of the WAL receiver on the node | String |
| postgresql.cluster.node.wal.replay.state | State of WAL replay on the node | String |
| postgresql.cluster.node.recovery.conflicts | Count of recovery conflicts on the node | Count |