-
Notifications
You must be signed in to change notification settings - Fork 903
feat: add health check monitoring to workspace apps #4114
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
Conversation
9aad6cb
to
f30a2e4
Compare
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.
Looks good so far. I assume we'll be adding the agent code that reports health as part of this too?
Yeah I can just continue on this branch until I get the tf connected. |
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.
FE looks good to me
cb8c83a
to
658c6dc
Compare
EOD Tuesday update - This is getting pretty close to end to end functional. I have a loop running on the agent, it reports the changes to coderd, and coderd exposes this in the api for the dashboard to display. Mostly just cleaning up and some more tests. |
PS - All of the changes around the |
11008e4
to
d3c4119
Compare
@kylecarbs I think this is ready to merge, I'm down to go through this on a call or something since it's large but hopefully since it's been reviewed multiple times already it shouldn't be too bad. |
@@ -0,0 +1,7 @@ | |||
CREATE TYPE workspace_app_health AS ENUM ('disabled', 'initializing', 'healthy', 'unhealthy'); |
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.
initializing
might be a bit misleading because it's really just paused waiting for the delay. What do you think about waiting
instead?
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.
Or maybe enabled
instead re the code checking if the URL is set below.
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.
It stays in initializing until it either gets healthy or unhealthy, which could take up to threshold * interval. I like initializing because it implies both enabled and waiting but no determined value yet.
} | ||
|
||
for _, app := range newApps { | ||
err = api.Database.UpdateWorkspaceAppHealthByID(r.Context(), database.UpdateWorkspaceAppHealthByIDParams{ |
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.
We could update these in one bulk request instead, similar to how we fetch by multiple IDs. That way, we wouldn't need to do any comparison logic I believe, and it'd be less DB requests.
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 wasn't sure how to do bulk updates in sqlc so I settled for this. I'm down to improve this in a separate PR if we can.
There is more to do to make this feature functional but this is safe to merge at this point since the default state is disabled.