From db429bd4b1be2f22e01017abe0bd9b35417c1ddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Krupa=20=28paulfantom=29?= Date: Sat, 23 Apr 2022 08:34:39 +0200 Subject: [PATCH] postgres_mixin/alerts: fix incorrect promql aggregation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Krupa (paulfantom) --- postgres_mixin/alerts/postgres.libsonnet | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/postgres_mixin/alerts/postgres.libsonnet b/postgres_mixin/alerts/postgres.libsonnet index d70f669d5..4b0275df1 100644 --- a/postgres_mixin/alerts/postgres.libsonnet +++ b/postgres_mixin/alerts/postgres.libsonnet @@ -61,8 +61,8 @@ summary: 'PostgreSQL high number of slow on {{ $labels.cluster }} for database {{ $labels.datname }} ', }, expr: ||| - avg( - rate by (datname) ( + avg by (datname) ( + rate ( pg_stat_activity_max_tx_duration{datname!~"template.*",%(postgresExporterSelector)s}[2m] ) ) > 2 * 60