Fixes AM wrongly counting alerts with EndTimes in the future as resolved

This commit is contained in:
conorbroderick 2018-02-07 15:52:26 +00:00
parent a43a513b77
commit e8832619e0

View File

@ -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()