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

Use REST for health checks #233

Closed
willmostly opened this issue Feb 2, 2024 · 4 comments
Closed

Use REST for health checks #233

willmostly opened this issue Feb 2, 2024 · 4 comments

Comments

@willmostly
Copy link
Contributor

willmostly commented Feb 2, 2024

Currently the Gateway supports either JDBC or REST for health checks. REST health checks use the /ui/api/stats endpoint, which is intended for use by the Trino UI, not external services, and has less flexible authentication options than other endpoints. JDBC based health checks create a lot of noise in query logs and other cluster metrics.

The /v1/jmx/mbean API provides the statistics needed for health checks:

  • /v1/jmx/mbean/trino.metadata:name=DiscoveryNodeManager provides ActiveNodeCount
  • /v1/jmx/mbean/trino.execution:name=QueryManager provides RunningQueries and QueuedQueries

ClusterStats also has a blockedQueries statistic, corresponding to BasicQueryStats.getFullyBlocked(). This is available from /ui/api/stats/ but not other endpoints listed here.

This endpoint can support any configured authentication method (unlike /ui/api/stats which must use web-ui.authentication.type). It doesn't require opening an extra port as jmx rmi would, and it doesn't require the coordinator to generate a query plan or spam the query logs.
One potential downside of the /v1/jmx/mbean API is that it relies on class and package name in trino to be constant.

@willmostly
Copy link
Contributor Author

Additional context trinodb/trino#17259

@mosabua
Copy link
Member

mosabua commented Feb 5, 2024

I think the proper healthcheck REST endpoint for Trino are the same as used in the docker container

http://localhost:8080/v1/info

or if you need more

http://localhost:8080/v1/status

@mosabua
Copy link
Member

mosabua commented Feb 5, 2024

And btw .. we should make a similar simple healtcheck for Trino Gateway

@ebyhr
Copy link
Member

ebyhr commented Mar 14, 2024

#264 added support for v1/info REST API. Let me close this issue.

@ebyhr ebyhr closed this as completed Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants