-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Response Ops][Task Manager] Return HealthStatus.Warning
instead of error when task manager stats are not yet available.
#169447
Conversation
@elasticmachine merge upstream |
53ce43b
to
ff28454
Compare
HealthStatus.Warning
instead of error when task manager stats are not yet available.
Pinging @elastic/response-ops (Team:ResponseOps) |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, LGTM!
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: cc @ymao1 |
@@ -19,6 +19,11 @@ export function calculateHealthStatus( | |||
): { status: HealthStatus; reason?: string } { | |||
const now = Date.now(); | |||
|
|||
// if stats are empty, return a warning | |||
if (isEmpty(summarizedStats.stats)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still see no health stats available
message at startup (it's now a warning).
I understand that the health URL must report something when called, but for the status observables there's no need IMO (on our status_service
we already consider plugins unavailable until they report otherwise).
@ymao1 I created a draft PR that addresses this by filtering out "empty" status emissions. It'd be nice if you could take a look to make sure I'm not causing undesired side effects:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @gsoldevila! That makes a lot of sense to me. I left one comment but the approach LGTM
Resolves #168237
Summary
This PR fixes a bug in the task manager status calculations that would return
0
for the "cold timestamp" when it didn't exist inside the stats and compare the difference ofnow - 0
against the required freshness threshold. This was causing the task manager status to initially be set toError
on startup (when there were no task manager stats available at all). Updated to return a warning with an appropriate reason message.To verify:
Run ES & Kibana on
main
. See startup logs warning about task manager health:Switch to this branch and run ES & Kibana. There should be no warnings about task manager errors in the logs.