You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: config/pgwatch-prometheus/metrics.yml
+14-8Lines changed: 14 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1110,8 +1110,9 @@ metrics:
1110
1110
n_tup_hot_upd,
1111
1111
n_live_tup,
1112
1112
n_dead_tup,
1113
-
greatest(last_autovacuum, last_vacuum, '1970-01-01Z') as last_vacuum,
1114
-
greatest(last_autoanalyze, last_analyze, '1970-01-01Z') as last_analyze,
1113
+
-- Prometheus gauges must be numeric. Export timestamps as epoch seconds.
1114
+
extract(epoch from greatest(last_autovacuum, last_vacuum, '1970-01-01Z'))::int8 as last_vacuum,
1115
+
extract(epoch from greatest(last_autoanalyze, last_analyze, '1970-01-01Z'))::int8 as last_analyze,
1115
1116
(vacuum_count + autovacuum_count) as vacuum_count,
1116
1117
(analyze_count + autoanalyze_count) as analyze_count
1117
1118
from
@@ -1252,7 +1253,10 @@ metrics:
1252
1253
This metric helps administrators identify indexes that may need maintenance like VACUUM FULL or index reorganization.
1253
1254
sqls:
1254
1255
11: |
1255
-
select current_database() as tag_datname, nspname as tag_schemaname, tblname as tag_tblname, idxname as tag_idxname, (bs*(relpages)/(1024*1024))::float as real_size_mib, /* pgwatch_generated */
1256
+
select /* pgwatch_generated */
1257
+
current_database() as tag_datname, nspname as tag_schemaname, tblname as tag_tblname, idxname as tag_idxname,
1258
+
(bs*(relpages)/(1024*1024))::float as real_size_mib,
1259
+
(pg_relation_size(tbloid)/(1024*1024))::float as table_size_mib,
1256
1260
(bs*(relpages-est_pages))::float as extra_size,
1257
1261
100 * (relpages-est_pages)::float / relpages as extra_pct,
0 commit comments