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

Feat: Healthcheck endpoints in deploy #37

Merged
merged 1 commit into from
Nov 28, 2023
Merged

Conversation

j-hall-mwam
Copy link
Contributor

@j-hall-mwam j-hall-mwam commented Nov 22, 2023

Add the following HTTP healthcheck endpoints to the deploy service:
/health/live
/health/ready
/health/startup

Currently, these always return status code 200 (OK), as setup is always completed before HTTP server comes online.

@j-hall-mwam j-hall-mwam requested a review from mw-lb November 22, 2023 17:12
@j-hall-mwam j-hall-mwam changed the title Healthcheck endpoints Feat: Healthcheck endpoints Nov 22, 2023
@mmniazi mmniazi changed the base branch from main to scalafmt November 22, 2023 18:47
@mmniazi mmniazi self-requested a review November 22, 2023 18:52
Copy link
Collaborator

@mmniazi mmniazi left a comment

Choose a reason for hiding this comment

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

Looks good but we need to add these endpoints to metrics API too

// after the HTTP server starts.
private val livenessEndpoint: PublicEndpoint[Unit, Nothing, Unit, Any] =
infallibleEndpoint.in("health").in("live").get
private val readinessEndpoint: PublicEndpoint[Unit, Nothing, Unit, Any] =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need 3 endpoints if all of them do exactly same thing for now?
(I don't have a strong preference) but I think it would make more sense to add more endpoints if and when we need them (we can start with just one)

Copy link
Collaborator

Choose a reason for hiding this comment

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

one advantage of 3 endpoints is that external users can hook up their startup/readiness/liveness probes to the endpoins and if we want to have different implementation in the future, they just upgrade, no need to change their helmrelease/whatever deployment.

mw-lb
mw-lb previously approved these changes Nov 22, 2023
Copy link
Collaborator

@mw-lb mw-lb left a comment

Choose a reason for hiding this comment

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

Metrics server needs these too but can be a separate PR.

I don't remember how the startup is done now, but there we can start the http server before the "__consumer_offsets" topic is read until the end (we can still serve topic offsets). I don't have a strong opinion though, let's explore the options and discuss what's best.

@j-hall-mwam j-hall-mwam force-pushed the healthcheck_endpoints branch from 53f1801 to 161444f Compare November 28, 2023 10:10
@j-hall-mwam j-hall-mwam force-pushed the scalafmt branch 4 times, most recently from 234977a to 0b5cf76 Compare November 28, 2023 13:38
Base automatically changed from scalafmt to main November 28, 2023 13:50
@j-hall-mwam j-hall-mwam dismissed mw-lb’s stale review November 28, 2023 13:50

The base branch was changed.

@j-hall-mwam j-hall-mwam force-pushed the healthcheck_endpoints branch from 161444f to a1d38d4 Compare November 28, 2023 14:34
@j-hall-mwam j-hall-mwam force-pushed the healthcheck_endpoints branch from a1d38d4 to 8e705a2 Compare November 28, 2023 14:44
@j-hall-mwam j-hall-mwam changed the title Feat: Healthcheck endpoints Feat: Healthcheck endpoints in deploy Nov 28, 2023
@j-hall-mwam j-hall-mwam merged commit e0b5c69 into main Nov 28, 2023
2 checks passed
@j-hall-mwam j-hall-mwam deleted the healthcheck_endpoints branch November 28, 2023 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants