From 716ac23f202f664845d04c0d7b07000feae19c59 Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Tue, 25 Jul 2023 22:36:51 +0200 Subject: [PATCH] Fixup new pg_stats_statements query (#876) Fix all renames of `total_time` to `total_exec_time`. Fixes: https://github.com/prometheus-community/postgres_exporter/issues/502 Signed-off-by: SuperQ --- collector/pg_stat_statements.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collector/pg_stat_statements.go b/collector/pg_stat_statements.go index e28c1c59..c03e78b9 100644 --- a/collector/pg_stat_statements.go +++ b/collector/pg_stat_statements.go @@ -105,9 +105,9 @@ var ( JOIN pg_database ON pg_database.oid = pg_stat_statements.dbid WHERE - total_time > ( + total_exec_time > ( SELECT percentile_cont(0.1) - WITHIN GROUP (ORDER BY total_time) + WITHIN GROUP (ORDER BY total_exec_time) FROM pg_stat_statements ) ORDER BY seconds_total DESC