mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
cmd/promtool: return errors from rule evaluations (#5483)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
parent
7efb8e9480
commit
abc1994bec
|
@ -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…
Reference in a new issue