From dccd4d04e17264c32130de36be48d672edd8d5a0 Mon Sep 17 00:00:00 2001 From: mctl-deploy Date: Tue, 26 May 2026 08:51:37 +0200 Subject: [PATCH] fix(observability): use > 1 for login-stall alert threshold increase() extrapolates to a floating-point value, so a window with exactly two timeouts can interpolate just under the >= 2 boundary (e.g. 1.97) and silently fail to fire. > 1 is rounding-safe and semantically identical for whole-number counter increments. Addresses the P2 from the PR #310 review. --- .../observability/vm-rules/mctl-telegram-alerts.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform-gitops/infra-components/observability/vm-rules/mctl-telegram-alerts.yaml b/platform-gitops/infra-components/observability/vm-rules/mctl-telegram-alerts.yaml index 9101163eb..e2a610e23 100644 --- a/platform-gitops/infra-components/observability/vm-rules/mctl-telegram-alerts.yaml +++ b/platform-gitops/infra-components/observability/vm-rules/mctl-telegram-alerts.yaml @@ -123,7 +123,10 @@ spec: # stall observable; see the "mctl-telegram — Login Flow" Grafana # dashboard for the corresponding panels. - alert: MctlTelegramLoginSendCodeStalls - expr: sum(increase(mctl_login_phone_step_total{result="timeout"}[15m])) >= 2 + # > 1 rather than >= 2: increase() extrapolates to a float, so an + # exactly-two-timeout window can interpolate to e.g. 1.97 and miss a + # >= 2 test. > 1 is rounding-safe and identical for integer counters. + expr: sum(increase(mctl_login_phone_step_total{result="timeout"}[15m])) > 1 for: 1m labels: severity: warning