Don't log rule evaluation failure on shutdown

This commit is contained in:
Fabian Reinartz 2016-01-18 16:53:37 +01:00
parent 7e1b39c682
commit a8c38c3ac5
1 changed files with 5 additions and 1 deletions

View File

@ -220,8 +220,12 @@ func (g *Group) eval() {
vector, err := rule.eval(now, g.opts.QueryEngine)
if err != nil {
// Canceled queries are intentional termination of queries. This normally
// happens on shutdown and thus we skip logging of any errors here.
if _, ok := err.(promql.ErrQueryCanceled); !ok {
log.Warnf("Error while evaluating rule %q: %s", rule, err)
}
evalFailures.Inc()
log.Warnf("Error while evaluating rule %q: %s", rule, err)
}
var rtyp ruleType