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

View file

@ -220,9 +220,13 @@ func (g *Group) eval() {
vector, err := rule.eval(now, g.opts.QueryEngine) vector, err := rule.eval(now, g.opts.QueryEngine)
if err != nil { if err != nil {
evalFailures.Inc() // 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) log.Warnf("Error while evaluating rule %q: %s", rule, err)
} }
evalFailures.Inc()
}
var rtyp ruleType var rtyp ruleType
switch r := rule.(type) { switch r := rule.(type) {