Add additional tag/log to rules Manager Eval trace span. (#7708)

Signed-off-by: Callum Styan <callumstyan@gmail.com>
This commit is contained in:
Callum Styan 2020-08-06 08:42:20 -07:00 committed by GitHub
parent 989260f7ed
commit c7a17f6491
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -576,6 +576,8 @@ func (g *Group) Eval(ctx context.Context, ts time.Time) {
if _, ok := err.(promql.ErrQueryCanceled); !ok {
level.Warn(g.logger).Log("msg", "Evaluating rule failed", "rule", rule, "err", err)
}
sp.SetTag("error", true)
sp.LogKV("error", err)
g.metrics.evalFailures.WithLabelValues(groupKey(g.File(), g.Name())).Inc()
return
}