From e68a3cf21f4132337c62fd335ff703fa7ac2a27a Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Tue, 22 Nov 2016 15:43:07 +0100 Subject: [PATCH] rules: update annotations on each iteration --- rules/alerting.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rules/alerting.go b/rules/alerting.go index 7b7ba9e256..6194c4afac 100644 --- a/rules/alerting.go +++ b/rules/alerting.go @@ -218,8 +218,11 @@ func (r *AlertingRule) Eval(ctx context.Context, ts model.Time, engine *promql.E fp := smpl.Metric.Fingerprint() resultFPs[fp] = struct{}{} + // Check whether we already have alerting state for the identifying label set. + // Update the last value and annotations if so, create a new alert entry otherwise. if alert, ok := r.active[fp]; ok && alert.State != StateInactive { alert.Value = smpl.Value + alert.Annotations = annotations continue }