Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mtojek
Copy link
Member

@mtojek mtojek commented Nov 15, 2023

Fixes: #9470
Replaces: #10620

This PR extends the /api/v2/debug/health API response to include warning []string field. Also, Coder will not report "unhealthy" status if there are troubles with Websockets.

Screenshot 2023-11-17 at 14 44 52

@mtojek mtojek self-assigned this Nov 15, 2023
@mtojek mtojek marked this pull request as ready for review November 17, 2023 14:18
type Report struct {
Healthy bool `json:"healthy"`
Healthy bool `json:"healthy"`
Warnings []string `json:"warnings"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a map[string][]string so that it's easier to identify the source of the warnings?

That way we don't need to worry about doing fmt.Sprintf("[%s] %s", prefix, warning") all the time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might also make easier for the UI to display them separately.

Copy link
Member Author

@mtojek mtojek Nov 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong preference here, but []string is convenient as it is defined the same way for every section. Frontend can just render all warnings as is. If you find it useful, I can just adjust the implementation though.

Copy link
Member Author

@mtojek mtojek Nov 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might also make easier for the UI to display them separately.

My main concern is consistency with other warnings []string fields, but I don't mind changing it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what would be easier for the UI, to be honest. Maybe we just ship and iterate?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree 👍

@mtojek mtojek merged commit 8999d57 into main Nov 17, 2023
@mtojek mtojek deleted the 9470-warnings branch November 17, 2023 15:00
@github-actions github-actions bot locked and limited conversation to collaborators Nov 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

health check endpoint: do not show healthy: false if Coder falls back to websockets

3 participants