From e8832619e045fe713d963822617f80d6c324a589 Mon Sep 17 00:00:00 2001 From: conorbroderick Date: Wed, 7 Feb 2018 15:52:26 +0000 Subject: [PATCH] Fixes AM wrongly counting alerts with EndTimes in the future as resolved --- api/api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/api.go b/api/api.go index 5e468c56..032d85db 100644 --- a/api/api.go +++ b/api/api.go @@ -493,7 +493,8 @@ func (api *API) insertAlerts(w http.ResponseWriter, r *http.Request, alerts ...* if alert.EndsAt.IsZero() { alert.Timeout = true alert.EndsAt = now.Add(resolveTimeout) - + } + if alert.EndsAt.After(time.Now()) { numReceivedAlerts.WithLabelValues("firing").Inc() } else { numReceivedAlerts.WithLabelValues("resolved").Inc()