PostgreSQL metrics

reference brazil Updated Sep 10, 2026 5 min read postgresql-metrics.md
Raw file servicenow.com

The following tables list and describe the metrics that are gathered as output from the specified PostgreSQL checks. Entries indicated as Featured metrics are high-visibility metrics that are displayed in the Operator Workspace Metric tab after an alert is generated. These metrics provide the operator with additional information to help them further explore the specified issue.

Metric

Description

pgsql.connections.active(Featured metric)

Provides metrics on the total active connections in the PostgreSQL database.

pgsql.connections.idle(Featured metric)

Provides metrics on the total idle connections on the PostgreSQL database.

Metric

Description

pgsql.db.size(Featured metric)

Provides metrics on the total disk size utilization for each of the PostgreSQL databases on the server.

|Metric|Description| |------|-----------| |pgsql.locks.AccessShareLock|Provides metrics on read-lock mode acquired automatically from queried tables.| |pgsql.locks.ExclusiveLock|Provides metrics on read-lock mode acquired by LOCK TABLE table for IN EXCLUSIVE MODE statements.|

Metric

Description

pgsql.tables_size(Featured metric)

Provides metrics on the database table size on the server.

Metric

Description

pgsql.statsbgwriter.buffers_alloc

Provides metrics related to the number of allocated buffers.

pgsql.statsbgwriter.buffers_backend

Provides metrics related to the number of buffers written directly by a backend.

pgsql.statsbgwriter.buffers_backend_fsync

Provides metrics related to the number of times a backend had to execute its own fsync call. Normally the background writer handles these calls, even when the backend performs its own write.

pgsql.statsbgwriter.buffers_checkpoint

Provides metrics related to the number of buffers written during checkpoints.

pgsql.statsbgwriter.buffers_clean

Provides metrics related to the number of buffers written by the background writer.

pgsql.statsbgwriter.checkpoint_sync_time

Provides metrics related to the total amount of time spent in the portion of checkpoint processing where files are synchronized to disk, in milliseconds.

pgsql.statsbgwriter.checkpoint_write_time

Provides metrics related to the total amount of time spent in the portion of checkpoint processing where files are written to disk, in milliseconds.

pgsql.statsbgwriter.checkpoints_req(Featured metric)

Provides metrics related to the number of requested checkpoints that have been performed.

pgsql.statsbgwriter.checkpoints_timed(Featured metric)

Provides metrics related to the number of scheduled checkpoints that have been performed.

pgsql.statsbgwriter.maxwritten_clean

Provides metrics related to the number of times the background writer stopped a cleaning scan because it had written too many buffers.

Metric

Description

pgsql.statsdb.blk_read_time(Featured metric)

Provides metrics related to the time spent reading data file blocks by backends in this database, in milliseconds.

pgsql.statsdb.blk_write_time(Featured metric)

Provides metrics related to the time spent writing data file blocks by backends in this database, in milliseconds.

pgsql.statsdb.blks_hit(Featured metric)

Provides metrics related to the number of times disk blocks were found in the buffer cache, so that a read was not necessary. This only includes hits in the PostgreSQL buffer cache, not the operating system's file system cache.

pgsql.statsdb.blks_read

Provides metrics related to the number of disk blocks read in this database.

pgsql.statsdb.checksum_failures

Provides metrics related to the number of data page checksum failures detected in this database (or on a shared object), or 0 if data checksums are not enabled.

pgsql.statsdb.conflicts

Provides metrics related to the number of queries canceled due to conflicts with recovery in this database. Conflicts occur only on standby servers.

pgsql.statsdb.deadlocks(Featured metric)

Provides metrics related to the number of deadlocks detected in this database.

pgsql.statsdb.numbackends

Provides metrics related to the number of backends currently connected to this database. This is the only column in this view that returns a value reflecting the current state; all other columns return the accumulated values since the last reset.

pgsql.statsdb.temp_bytes

Provides metrics related to the total amount of data written to temporary files by queries in this database. All temporary files are counted, regardless of why the temporary file was created, and regardless of the log_temp_files setting.

pgsql.statsdb.temp_files

Provides metrics related to the number of temporary files created by queries in this database. All temporary files are counted, regardless of why the temporary file was created (such as sorting or hashing), and regardless of the log_temp_files setting.

pgsql.statsdb.tup_deleted

Provides metrics related to the number of rows deleted by queries in this database.

pgsql.statsdb.tup_fetched

Provides metrics related to the number of rows fetched by queries in this database.

pgsql.statsdb.tup_inserted

Provides metrics related to the number of rows inserted by queries in this database.

pgsql.statsdb.tup_returned

Provides metrics related to the number of rows returned by queries in this database.

pgsql.statsdb.tup_updated

Provides metrics related to the number of rows updated by queries in this database.

pgsql.statsdb.xact_commit

Provides metrics related to the number of transactions in this database that have been committed.

pgsql.statsdb.xact_rollback

Provides metrics related to the number of transactions in this database that have been rolled back.

Metric

Description

pgsql.statsio.heap_blks_hit(Featured metric)

Provides metrics related to the number of buffer hits in this table.

pgsql.statsio.heap_blks_read

Provides metrics related to the number of disk blocks read from this table.

pgsql.statsio.idx_blks_hit

Provides metrics related to the number of buffer hits in all indexes in this table.

pgsql.statsio.idx_blks_read

Provides metrics related to the number of disk blocks read from all indexes in this table.

pgsql.statsio.tidx_blks_hit

Provides metrics related to the number of buffer hits in this table's TOAST table index (if any).

pgsql.statsio.tidx_blks_read

Provides metrics related to the number of disk blocks read from this table's TOAST table index.

pgsql.statsio.toast_blks_hit

Provides metrics related to the number of buffer hits in this table's TOAST table (if any).

pgsql.statsio.toast_blks_read

Provides metrics related to the number of disk blocks read from this table's TOAST table (if any).

|Metric|Description| |------|-----------| |pgsql.statstable.idx\_scan|Provides metrics related to the number of index scans initiated on this table.| |pgsql.statstable.idx\_tup\_fetch|Provides metrics related to the number of live rows fetched by index scans.| |pgsql.statstable.n\_dead\_tup|Provides metrics related to the estimated number of dead rows.| |pgsql.statstable.n\_live\_tup|Provides metrics related to the estimated number of live rows.| |pgsql.statstable.n\_tup\_del|Provides metrics related to the number of deleted rows.| |pgsql.statstable.n\_tup\_hot\_upd|Provides metrics related to the number of rows HOT updated \(that is, with no separate index update required\).| |pgsql.statstable.n\_tup\_ins|Provides metrics related to the number of inserted rows.| |pgsql.statstable.n\_tup\_upd|Provides metrics related to the number of updated rows.| |pgsql.statstable.seq\_scan|Provides metrics related to the number of sequential scans initiated on this table.| |pgsql.statstable.seq\_tup\_read|Provides metrics related to the number of live rows fetched by sequential scans.|

Parent Topic:Agent Client Collector Monitoring default checks and policies

Search documentation
Search document titles and file paths on the brazil branch