Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add healthcheck to report to zui for errors #2143

Merged
merged 6 commits into from
Dec 5, 2023
Merged

Conversation

AbdelrahmanElawady
Copy link
Contributor

@AbdelrahmanElawady AbdelrahmanElawady commented Nov 28, 2023

Description

Add healthcheck task to execute multiple checks (only cache for now) and report to zui for errors. It also set flags that can be checked by Power daemon to stop uptime reports.

Changes

  • Add and register zui module on zbus to allow other modules to set some errors in the ui.
  • Add healthcheck Task that perform checks on the node to make sure everything is OK.
  • Add another part in the ui to display errors with the node state.
  • Stop uptime reports if cache is unusable (readonly or limited).

Related Issues

Checklist

  • Tests included
  • Build pass
  • Documentation
  • Code format and docstring

@AbdelrahmanElawady
Copy link
Contributor Author

Here is how it looks on the ui:
image_2023-11-28_18-19-15
it was tested using chattr +i /var/cache to make sure creating the file is not possible.

still missing:

  • checking the error flag in the uptime goroutine.
  • wrapping the errors in zui if the errors are large.
  • some docs.

@scottyeager
Copy link

This view is a bit confusing, since it shows cache disk: OK above and an error on cache below. I think it's better to write the error in place of the OK message for the cache. If future health checks create the need for a separate errors section, it can be added later.

@AbdelrahmanElawady
Copy link
Contributor Author

It is showing OK because a check for Readonly cache hasn't been added yet, it will be added with the other remaining changes. A separate section for errors in ZOS node is more helpful to get more details of what is wrong without cluttering the first section (it already has a lot of information) and to support multiple health checks. But that's my opinion.

@scottyeager
Copy link

Okay, that makes sense, @AbdelrahmanElawady. In that case it looks good to me.

cmds/modules/zui/header.go Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
go.sum Outdated Show resolved Hide resolved
pkg/perf/healthcheck/healthcheck.go Outdated Show resolved Hide resolved
pkg/perf/healthcheck/healthcheck.go Outdated Show resolved Hide resolved
pkg/power/uptime.go Outdated Show resolved Hide resolved
pkg/zui.go Outdated Show resolved Hide resolved
pkg/zui/zui.go Outdated Show resolved Hide resolved
pkg/zui/zui.go Outdated Show resolved Hide resolved
@muhamadazmy muhamadazmy merged commit 4272bcb into main Dec 5, 2023
23 checks passed
@muhamadazmy muhamadazmy deleted the add-healthcheck branch December 5, 2023 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants