Merge pull request #2213 from prometheus/alertannotations

rules: update annotations on each iteration
This commit is contained in:
Fabian Reinartz 2016-11-22 15:55:18 +01:00 committed by GitHub
commit c34f55d7c0

View file

@ -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
}