Skip to content

Commit c3eec8d

Browse files
Introduce a pg_stat_slru metric
1 parent 967bd50 commit c3eec8d

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

config/pgwatch-prometheus/metrics.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,37 @@ metrics:
10931093
- latest_end_time
10941094
- upstream_node
10951095
statement_timeout_seconds: 15
1096+
pg_stat_slru:
1097+
description: >
1098+
Retrieves statistics from the PostgreSQL `pg_stat_slru` view for SLRU (Simple Least Recently Used) caches.
1099+
It tracks various SLRU caches like subtrans, multixact_offset, multixact_member, notify, serial, and clog.
1100+
Each cache reports blocks zeroed, hit, read, written, exists checks, flushes, truncates, and last stats reset time.
1101+
This metric helps administrators monitor SLRU cache performance and identify potential issues with transaction ID wraparound or other system caches.
1102+
sqls:
1103+
11: "; -- not available before PG 13"
1104+
13: |-
1105+
select /* pgwatch_generated */
1106+
current_database() as tag_datname,
1107+
name as tag_name,
1108+
blks_zeroed,
1109+
blks_hit,
1110+
blks_read,
1111+
blks_written,
1112+
blks_exists,
1113+
flushes,
1114+
truncates,
1115+
extract(epoch from stats_reset)::int8 as stats_reset_epoch
1116+
from pg_stat_slru
1117+
gauges:
1118+
- blks_zeroed
1119+
- blks_hit
1120+
- blks_read
1121+
- blks_written
1122+
- blks_exists
1123+
- flushes
1124+
- truncates
1125+
- stats_reset_epoch
1126+
statement_timeout_seconds: 15
10961127
pg_stuck_idle_in_transaction:
10971128
sqls:
10981129
11: |
@@ -2193,6 +2224,7 @@ presets:
21932224
pg_stat_all_indexes: 30
21942225
pg_stat_statements: 30
21952226
pg_stat_replication: 30
2227+
pg_stat_slru: 30
21962228
pg_statio_all_tables: 30
21972229
pg_statio_all_indexes: 30
21982230
pg_total_relation_size: 30

0 commit comments

Comments
 (0)