description:"Flag indicating whether the slot is active"
- pg_wal_lsn_diff:
usage:"GAUGE"
description:"Replication lag in bytes"
pg_stat_archiver:
query:|
SELECT archived_count
,failed_count
,COALESCE(EXTRACT(EPOCH FROM (now() - last_archived_time)), -1) AS seconds_since_last_archival
,COALESCE(EXTRACT(EPOCH FROM (now() - last_failed_time)), -1) AS seconds_since_last_failure
,COALESCE(EXTRACT(EPOCH FROM last_archived_time), -1) AS last_archived_time
,COALESCE(EXTRACT(EPOCH FROM last_failed_time), -1) AS last_failed_time
,COALESCE(CAST(CAST('x'||pg_catalog.right(pg_catalog.split_part(last_archived_wal, '.', 1), 16) AS pg_catalog.bit(64)) AS pg_catalog.int8), -1) AS last_archived_wal_start_lsn
,COALESCE(CAST(CAST('x'||pg_catalog.right(pg_catalog.split_part(last_failed_wal, '.', 1), 16) AS pg_catalog.bit(64)) AS pg_catalog.int8), -1) AS last_failed_wal_start_lsn
,EXTRACT(EPOCH FROM stats_reset) AS stats_reset_time
FROM pg_catalog.pg_stat_archiver
metrics:
- archived_count:
usage:"COUNTER"
description:"Number of WAL files that have been successfully archived"
- failed_count:
usage:"COUNTER"
description:"Number of failed attempts for archiving WAL files"
- seconds_since_last_archival:
usage:"GAUGE"
description:"Seconds since the last successful archival operation"
- seconds_since_last_failure:
usage:"GAUGE"
description:"Seconds since the last failed archival operation"
- last_archived_time:
usage:"GAUGE"
description:"Epoch of the last time WAL archiving succeeded"
- last_failed_time:
usage:"GAUGE"
description:"Epoch of the last time WAL archiving failed"
- last_archived_wal_start_lsn:
usage:"GAUGE"
description:"Archived WAL start LSN"
- last_failed_wal_start_lsn:
usage:"GAUGE"
description:"Last failed WAL LSN"
- stats_reset_time:
usage:"GAUGE"
description:"Time at which these statistics were last reset"
pg_stat_bgwriter:
query:|
SELECT checkpoints_timed
,checkpoints_req
,checkpoint_write_time
,checkpoint_sync_time
,buffers_checkpoint
,buffers_clean
,maxwritten_clean
,buffers_backend
,buffers_backend_fsync
,buffers_alloc
FROM pg_catalog.pg_stat_bgwriter
metrics:
- checkpoints_timed:
usage:"COUNTER"
description:"Number of scheduled checkpoints that have been performed"
- checkpoints_req:
usage:"COUNTER"
description:"Number of requested checkpoints that have been performed"
- checkpoint_write_time:
usage:"COUNTER"
description:"Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk, in milliseconds"
- checkpoint_sync_time:
usage:"COUNTER"
description:"Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk, in milliseconds"
- buffers_checkpoint:
usage:"COUNTER"
description:"Number of buffers written during checkpoints"
- buffers_clean:
usage:"COUNTER"
description:"Number of buffers written by the background writer"
- maxwritten_clean:
usage:"COUNTER"
description:"Number of times the background writer stopped a cleaning scan because it had written too many buffers"
- buffers_backend:
usage:"COUNTER"
description:"Number of buffers written directly by a backend"
- buffers_backend_fsync:
usage:"COUNTER"
description:"Number of times a backend had to execute its own fsync call (normally the background writer handles those even when the backend does its own write)"
- buffers_alloc:
usage:"COUNTER"
description:"Number of buffers allocated"
pg_stat_database:
query:|
SELECT datname
,xact_commit
,xact_rollback
,blks_read
,blks_hit
,tup_returned
,tup_fetched
,tup_inserted
,tup_updated
,tup_deleted
,conflicts
,temp_files
,temp_bytes
,deadlocks
,blk_read_time
,blk_write_time
FROM pg_catalog.pg_stat_database
metrics:
- datname:
usage:"LABEL"
description:"Name of this database"
- xact_commit:
usage:"COUNTER"
description:"Number of transactions in this database that have been committed"
- xact_rollback:
usage:"COUNTER"
description:"Number of transactions in this database that have been rolled back"
- blks_read:
usage:"COUNTER"
description:"Number of disk blocks read in this database"
- blks_hit:
usage:"COUNTER"
description:"Number of times disk blocks were found already 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)"
- tup_returned:
usage:"COUNTER"
description:"Number of rows returned by queries in this database"
- tup_fetched:
usage:"COUNTER"
description:"Number of rows fetched by queries in this database"
- tup_inserted:
usage:"COUNTER"
description:"Number of rows inserted by queries in this database"
- tup_updated:
usage:"COUNTER"
description:"Number of rows updated by queries in this database"
- tup_deleted:
usage:"COUNTER"
description:"Number of rows deleted by queries in this database"
- conflicts:
usage:"COUNTER"
description:"Number of queries canceled due to conflicts with recovery in this database"
- temp_files:
usage:"COUNTER"
description:"Number of temporary files created by queries in this database"
- temp_bytes:
usage:"COUNTER"
description:"Total amount of data written to temporary files by queries in this database"
- deadlocks:
usage:"COUNTER"
description:"Number of deadlocks detected in this database"
- blk_read_time:
usage:"COUNTER"
description:"Time spent reading data file blocks by backends in this database, in milliseconds"
- blk_write_time:
usage:"COUNTER"
description:"Time spent writing data file blocks by backends in this database, in milliseconds"
pg_stat_replication:
primary:true
query:|
SELECT usename
,COALESCE(application_name, '') AS application_name