@@ -1093,6 +1093,37 @@ metrics:
10931093 -latest_end_time
10941094 -upstream_node
10951095statement_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
10961127pg_stuck_idle_in_transaction :
10971128sqls :
1098112911 :|
@@ -2193,6 +2224,7 @@ presets:
21932224pg_stat_all_indexes :30
21942225pg_stat_statements :30
21952226pg_stat_replication :30
2227+ pg_stat_slru :30
21962228pg_statio_all_tables :30
21972229pg_statio_all_indexes :30
21982230pg_total_relation_size :30