Skip to content

Commit 6152c7b

Browse files
committed
feat(loki/src/k8s_events): check on bubbled up errors to set health accordingly
Signed-off-by: hainenber <[email protected]>
1 parent 8e7825d commit 6152c7b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

component/loki/source/kubernetes_events/kubernetes_events.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,16 @@ func (c *Component) Run(ctx context.Context) error {
161161
c.setHealth(err)
162162
level.Error(c.log).Log("msg", "failed to apply event watchers", "err", err)
163163
}
164+
165+
// Check on bubbled up errors encountered by the workers when running applied tasks
166+
// and set component health accordingly
167+
appliedTaskErrorString := ""
168+
for _, err := range c.runner.GetWorkerErrors() {
169+
appliedTaskErrorString += err.Error() + "\n"
170+
}
171+
if appliedTaskErrorString != "" {
172+
c.setHealth(fmt.Errorf(appliedTaskErrorString))
173+
}
164174
}
165175
}
166176
}, func(_ error) {

0 commit comments

Comments
 (0)