feat: simplify HealthCheckService #4218
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR changes/adds
This PR simplifies and refactors the health check feature in the following aspects:
HealthCheckService
does not cache results anymore, to avoid additional latencies, and potentially wrong system health statusHealthCheckResult#component
field is now mandatory, because it makes no sense to have unnamed component resultsHealthCheckResult
are deprecated in favor of theBuilder
as they don't enforce the non-nullness of thecomponent
fieldHealthCheckServiceConfiguration
at it is not needed anymoreWhy it does that
Caching health results may increase the responsiveness of the caller (e.g. Kubernetes probes), but will ultimately introduce an additional delay, and convey a potentially wrong system picture: components don't show up in the overall result unless either
refresh()
was called, or the next update cycle had gone through.Configuring periods, delays etc. should be up to the caller, not the health check system.
Further notes
DataplaneSelfRegistrationExtension
to have K8S kill the pod if the self-registration fails.Linked Issue(s)
Closes # <-- insert Issue number if one exists
Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.