@@ -31,15 +31,15 @@ pg_stat_user_tables:
3131 n_live_tup,
3232 n_dead_tup,
3333 n_mod_since_analyze,
34- COALESCE(last_vacuum, '1970-01-01Z') as last_vacuum,
35- COALESCE(last_autovacuum, '1970-01-01Z') as last_autovacuum,
36- COALESCE(last_analyze, '1970-01-01Z') as last_analyze,
37- COALESCE(last_autoanalyze, '1970-01-01Z') as last_autoanalyze,
38- vacuum_count,
39- autovacuum_count,
40- analyze_count,
41- autoanalyze_count
42- FROM
34+ COALESCE(last_vacuum, '1970-01-01Z') as last_vacuum,
35+ COALESCE(last_autovacuum, '1970-01-01Z') as last_autovacuum,
36+ COALESCE(last_analyze, '1970-01-01Z') as last_analyze,
37+ COALESCE(last_autoanalyze, '1970-01-01Z') as last_autoanalyze,
38+ vacuum_count,
39+ autovacuum_count,
40+ analyze_count,
41+ autoanalyze_count
42+ FROM
4343 pg_stat_user_tables
4444 metrics :
4545 - datname :
@@ -145,7 +145,7 @@ pg_statio_user_tables:
145145 - tidx_blks_hit :
146146 usage : " COUNTER"
147147 description : " Number of buffer hits in this table's TOAST table indexes (if any)"
148-
148+
149149pg_database :
150150 query : " SELECT pg_database.datname, pg_database_size(pg_database.datname) as size_bytes FROM pg_database"
151151 master : true
@@ -229,7 +229,7 @@ pg_stat_statements:
229229 usage : " COUNTER"
230230 description : " Total time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)"
231231
232- pg_stat_activity :
232+ pg_process_idle :
233233 query : |
234234 WITH
235235 metrics AS (
@@ -259,16 +259,16 @@ pg_stat_activity:
259259 )
260260 SELECT
261261 application_name,
262- process_idle_seconds_sum,
263- process_idle_seconds_count,
264- ARRAY_AGG(le) AS process_idle_seconds ,
265- ARRAY_AGG(bucket) AS process_idle_seconds_bucket
262+ process_idle_seconds_sum as seconds_sum ,
263+ process_idle_seconds_count as seconds_count ,
264+ ARRAY_AGG(le) AS seconds ,
265+ ARRAY_AGG(bucket) AS seconds_bucket
266266 FROM metrics JOIN buckets USING (application_name)
267267 GROUP BY 1, 2, 3
268268 metrics :
269269 - application_name :
270270 usage : " LABEL"
271271 description : " Application Name"
272- - process_idle_seconds :
272+ - seconds :
273273 usage : " HISTOGRAM"
274274 description : " Idle time of server processes"
0 commit comments