From 9a99a82e92b669f9e3a79898387b6e8d6af4d62b Mon Sep 17 00:00:00 2001 From: ZdenekSrotyr Date: Tue, 21 Apr 2026 20:36:09 +0200 Subject: [PATCH] =?UTF-8?q?fix(infra):=20alert=20policy=20aggregation=20?= =?UTF-8?q?=E2=80=94=20drop=20cross=5Fseries=5Freducer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCP rejected the policy with 'REDUCE_COUNT_FALSE cannot be applied to metrics with value type DOUBLE' — because ALIGN_FRACTION_TRUE already produces a fraction 0..1 per series, no need for an additional cross-series reducer. Simplified: alert when the per-series fraction < 1 for 5 min. Review M4 predicted this — uptime check filters needed double-checking against live GCP. --- infra/modules/customer-instance/main.tf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/infra/modules/customer-instance/main.tf b/infra/modules/customer-instance/main.tf index c5051d6..b8cf4cd 100644 --- a/infra/modules/customer-instance/main.tf +++ b/infra/modules/customer-instance/main.tf @@ -289,16 +289,16 @@ resource "google_monitoring_alert_policy" "health_failure" { conditions { display_name = "Uptime check failed > 5 min" condition_threshold { - filter = "metric.type=\"monitoring.googleapis.com/uptime_check/check_passed\" AND metric.labels.check_id=\"${google_monitoring_uptime_check_config.health[each.key].uptime_check_id}\" AND resource.type=\"uptime_url\"" + filter = "metric.type=\"monitoring.googleapis.com/uptime_check/check_passed\" AND metric.labels.check_id=\"${google_monitoring_uptime_check_config.health[each.key].uptime_check_id}\" AND resource.type=\"uptime_url\"" duration = "300s" + # ALIGN_FRACTION_TRUE yields fraction of checks that returned true. + # If the fraction stays < 1 (i.e. any probe failed) for 5 min → alert. comparison = "COMPARISON_LT" threshold_value = 1 aggregations { - alignment_period = "60s" - per_series_aligner = "ALIGN_FRACTION_TRUE" - cross_series_reducer = "REDUCE_COUNT_FALSE" - group_by_fields = ["resource.label.host"] + alignment_period = "60s" + per_series_aligner = "ALIGN_FRACTION_TRUE" } trigger {