mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 22:19:40 -08:00
cmd/promtool: return errors from rule evaluations (#5483)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
parent
f2ca36e56a
commit
31a2d14e2f
|
@ -210,6 +210,12 @@ func (tg *testGroup) test(mint, maxt time.Time, evalInterval time.Duration, grou
|
||||||
}
|
}
|
||||||
for _, g := range groups {
|
for _, g := range groups {
|
||||||
g.Eval(suite.Context(), ts)
|
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 {
|
if len(errs) > 0 {
|
||||||
|
|
Loading…
Reference in a new issue