cmd/promtool: return errors from rule evaluations (#5483)

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
pull/5498/head
Simon Pasquier 7 years ago committed by GitHub
parent 7efb8e9480
commit abc1994bec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      cmd/promtool/unittest.go

@ -210,6 +210,12 @@ func (tg *testGroup) test(mint, maxt time.Time, evalInterval time.Duration, grou
}
for _, g := range groups {
g.Eval(suite.Context(), ts)
for _, r := range g.Rules() {
if r.LastError() != nil {
errs = append(errs, errors.Errorf(" rule: %s, time: %s, err: %v",
r.Name(), ts.Sub(time.Unix(0, 0)), r.LastError()))
}
}
}
})
if len(errs) > 0 {

Loading…
Cancel
Save