Skip to content

Commit 859d202

Browse files
Added pg_statio_all_tables metric
1 parent 78dfd22 commit 859d202

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

config/pgwatch-prometheus/metrics.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2068,6 +2068,34 @@ metrics:
20682068
gauges:
20692069
- config_value_normalized
20702070

2071+
pg_statio_all_tables:
2072+
description: >
2073+
Retrieves table-level I/O statistics from the PostgreSQL `pg_statio_all_tables` view, providing insights into I/O operations for all tables.
2074+
It returns block-level read and hit statistics for heap, index, TOAST, and TOAST index operations broken down by schema and table.
2075+
This metric helps administrators monitor table-level I/O performance and identify which tables are generating the most I/O activity.
2076+
Compatible with all PostgreSQL versions.
2077+
sqls:
2078+
11: |-
2079+
select /* pgwatch_generated */
2080+
(extract(epoch from now()) * 1e9)::int8 as epoch_ns,
2081+
current_database() as tag_datname,
2082+
schemaname as tag_schemaname,
2083+
relname as tag_relname,
2084+
heap_blks_read,
2085+
heap_blks_hit,
2086+
idx_blks_read,
2087+
idx_blks_hit,
2088+
toast_blks_read,
2089+
toast_blks_hit,
2090+
tidx_blks_read,
2091+
tidx_blks_hit
2092+
from
2093+
pg_statio_all_tables
2094+
where
2095+
heap_blks_read > 0 or idx_blks_read > 0 or toast_blks_read > 0 or tidx_blks_read > 0
2096+
gauges:
2097+
- '*'
2098+
20712099

20722100
presets:
20732101
full:
@@ -2092,6 +2120,7 @@ presets:
20922120
pg_stat_user_indexes: 30
20932121
pg_stat_statements: 30
20942122
pg_stat_replication: 30
2123+
pg_statio_all_tables: 30
20952124
pg_total_relation_size: 30
20962125
pg_blocked: 30
20972126
pg_long_running_transactions: 30

0 commit comments

Comments
 (0)