Skip to content

Commit e5b57fd

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 29114b8 commit e5b57fd

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
@@ -159,6 +159,16 @@ func (c *Component) Run(ctx context.Context) error {
159159
c.setHealth(err)
160160
level.Error(c.log).Log("msg", "failed to apply event watchers", "err", err)
161161
}
162+
163+
// Check on bubbled up errors encountered by the workers when running applied tasks
164+
// and set component health accordingly
165+
appliedTaskErrorString := ""
166+
for _, err := range c.runner.GetWorkerErrors() {
167+
appliedTaskErrorString += err.Error() + "\n"
168+
}
169+
if appliedTaskErrorString != "" {
170+
c.setHealth(fmt.Errorf(appliedTaskErrorString))
171+
}
162172
}
163173
}
164174
}, func(_ error) {

0 commit comments

Comments
 (0)