From a8c38c3ac5f9d41cd99e7a45c55fcf04c14321c8 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Mon, 18 Jan 2016 16:53:37 +0100 Subject: [PATCH] Don't log rule evaluation failure on shutdown --- rules/manager.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rules/manager.go b/rules/manager.go index 212c9f9e5..d779979b7 100644 --- a/rules/manager.go +++ b/rules/manager.go @@ -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