mirror of
https://github.com/prometheus/alertmanager
synced 2024-12-28 00:52:13 +00:00
Merge pull request #1233 from Conorbro/resolved-alert-counter-fix
Fixes AM wrongly counting alerts with EndTimes in the future as resolved
This commit is contained in:
commit
168cb217c6
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user