From a13601c38baee7c0dc44209b5bdcc0684995cb1c Mon Sep 17 00:00:00 2001 From: QuentinBisson Date: Thu, 26 Sep 2024 16:38:02 +0200 Subject: [PATCH] Fix alert to support multiple compactor pods running --- production/loki-mixin-compiled-ssd/alerts.yaml | 4 ++-- production/loki-mixin-compiled/alerts.yaml | 4 ++-- production/loki-mixin/alerts.libsonnet | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/production/loki-mixin-compiled-ssd/alerts.yaml b/production/loki-mixin-compiled-ssd/alerts.yaml index ff402a6195b0d..77c2be817536e 100644 --- a/production/loki-mixin-compiled-ssd/alerts.yaml +++ b/production/loki-mixin-compiled-ssd/alerts.yaml @@ -52,10 +52,10 @@ groups: # The "last successful run" metric is updated even if the compactor owns no tenants, # so this alert correctly doesn't fire if compactor has nothing to do. min ( - time() - (loki_boltdb_shipper_compact_tables_operation_last_successful_run_timestamp_seconds{} > 0 + time() - (loki_boltdb_shipper_compact_tables_operation_last_successful_run_timestamp_seconds{} > 0) ) by (cluster, namespace) - > 60 * 60 * 24) + > 60 * 60 * 24 for: 1h labels: severity: critical diff --git a/production/loki-mixin-compiled/alerts.yaml b/production/loki-mixin-compiled/alerts.yaml index ff402a6195b0d..77c2be817536e 100644 --- a/production/loki-mixin-compiled/alerts.yaml +++ b/production/loki-mixin-compiled/alerts.yaml @@ -52,10 +52,10 @@ groups: # The "last successful run" metric is updated even if the compactor owns no tenants, # so this alert correctly doesn't fire if compactor has nothing to do. min ( - time() - (loki_boltdb_shipper_compact_tables_operation_last_successful_run_timestamp_seconds{} > 0 + time() - (loki_boltdb_shipper_compact_tables_operation_last_successful_run_timestamp_seconds{} > 0) ) by (cluster, namespace) - > 60 * 60 * 24) + > 60 * 60 * 24 for: 1h labels: severity: critical diff --git a/production/loki-mixin/alerts.libsonnet b/production/loki-mixin/alerts.libsonnet index 160b15339c2c3..ad7bc59fb1729 100644 --- a/production/loki-mixin/alerts.libsonnet +++ b/production/loki-mixin/alerts.libsonnet @@ -77,10 +77,10 @@ # The "last successful run" metric is updated even if the compactor owns no tenants, # so this alert correctly doesn't fire if compactor has nothing to do. min ( - time() - (loki_boltdb_shipper_compact_tables_operation_last_successful_run_timestamp_seconds{} > 0 + time() - (loki_boltdb_shipper_compact_tables_operation_last_successful_run_timestamp_seconds{} > 0) ) by (%s, namespace) - > 60 * 60 * 24) + > 60 * 60 * 24 ||| % $._config.per_cluster_label, 'for': '1h', labels: {