mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 21:54:10 -08:00
Don't reset FiredAt for inactive alerts
Otherwise AlertManager receives resolved alerts where StartsAt is zero which fails the validation.
This commit is contained in:
parent
09e460a647
commit
81c0ab69e0
|
@ -649,7 +649,7 @@ func computeExternalURL(u, listenAddr string) (*url.URL, error) {
|
||||||
return eu, nil
|
return eu, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// sendAlerts implements a the rules.NotifyFunc for a Notifier.
|
// sendAlerts implements the rules.NotifyFunc for a Notifier.
|
||||||
// It filters any non-firing alerts from the input.
|
// It filters any non-firing alerts from the input.
|
||||||
func sendAlerts(n *notifier.Notifier, externalURL string) rules.NotifyFunc {
|
func sendAlerts(n *notifier.Notifier, externalURL string) rules.NotifyFunc {
|
||||||
return func(ctx context.Context, expr string, alerts ...*rules.Alert) error {
|
return func(ctx context.Context, expr string, alerts ...*rules.Alert) error {
|
||||||
|
|
|
@ -266,7 +266,6 @@ func (r *AlertingRule) Eval(ctx context.Context, ts time.Time, query QueryFunc,
|
||||||
if a.State != StateInactive {
|
if a.State != StateInactive {
|
||||||
a.State = StateInactive
|
a.State = StateInactive
|
||||||
a.ResolvedAt = ts
|
a.ResolvedAt = ts
|
||||||
a.FiredAt = time.Time{}
|
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue