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

Add health check API endpoints #595

Merged
merged 9 commits into from
Feb 5, 2025

Conversation

oneonestar
Copy link
Member

Description

Add two new health check API endpoints: /trino-gateway/livez and /trino-gateway/readyz.

Additional context and related issues

/trino-gateway/livez always returns 200.
/trino-gateway/readyz returns 200 after the initial fetch from database and the first round of Trino cluster health check is completed. Otherwise, 503 will be returned.

Release notes

(x) Release notes are required, with the following suggested text:

* Added API health endpoints `/trino-gateway/livez` and `/trino-gateway/readyz` for monitoring liveness and readiness. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Jan 21, 2025
@oneonestar oneonestar force-pushed the star/health_check_endpoint branch from ede6246 to 819c956 Compare January 21, 2025 01:43
@oneonestar oneonestar marked this pull request as draft January 21, 2025 02:30
@oneonestar
Copy link
Member Author

Might need to bind ActiveClusterMonitor by default instead of injecting it in config.

@mosabua
Copy link
Member

mosabua commented Jan 21, 2025

Have not really looked at the PR but I think we should agree on same names for those probes in Trino Gateway and Trino . What do you think are suitable URLs .. I think it could literally just be ready and live, or liveness and readiness .. or is there some standard that anyone is aware of?

@nineinchnick @martint @dain @electrum ?

Copy link
Member

@nineinchnick nineinchnick left a comment

Choose a reason for hiding this comment

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

AFAIK Trino doesn't yet have endpoints dedicated for probes. The z suffix is a convention started at Google, widely adopted in Kubernetes apps. I'm ok with that, OTOH there's little chance we'll have conflicts with other endpoints.

@mosabua
Copy link
Member

mosabua commented Jan 21, 2025

AFAIK Trino doesn't yet have endpoints dedicated for probes. The z suffix is a convention started at Google, widely adopted in Kubernetes apps. I'm ok with that, OTOH there's little chance we'll have conflicts with other endpoints.

Fair enough .. i saw the healthz in others but the two you created @oneonestar are better .. so lets run with that then.

@oneonestar oneonestar force-pushed the star/health_check_endpoint branch from 819c956 to d20f52e Compare January 24, 2025 04:33
@oneonestar oneonestar marked this pull request as ready for review January 24, 2025 08:28
@oneonestar oneonestar force-pushed the star/health_check_endpoint branch from 72becaa to 034b5f6 Compare January 25, 2025 00:23
Copy link
Member

@mosabua mosabua left a comment

Choose a reason for hiding this comment

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

Mini nits for the docs, then good to go. Feel free to merge after fixing docs and testing locally

oneonestar and others added 4 commits February 6, 2025 08:06
Co-authored-by: Manfred Moser <[email protected]>
Co-authored-by: Manfred Moser <[email protected]>
Co-authored-by: Manfred Moser <[email protected]>
Co-authored-by: Manfred Moser <[email protected]>
@oneonestar
Copy link
Member Author

Local test looks good. Merging.
image

@mosabua
Copy link
Member

mosabua commented Feb 5, 2025

Great.,., just make sure you squash commits...

@oneonestar oneonestar merged commit 3a82b83 into trinodb:main Feb 5, 2025
2 checks passed
@oneonestar oneonestar deleted the star/health_check_endpoint branch February 5, 2025 23:31
@github-actions github-actions bot added this to the 14 milestone Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants