GIScience / ohsome-api

API for analysing OpenStreetMap history data
https://api.ohsome.org
GNU Affero General Public License v3.0
46 stars 7 forks source link

Feature Request: Health Check #143

Open joker234 opened 3 years ago

joker234 commented 3 years ago

Currently, the ohsome API doesn't provide any health check. A health check should provide a statement if the ohsome API is ready to be used. This can depend on a health check that the OSHDB would provide as well as a check if all connections (database, ignite, …) are still working. What the ohsome API needs to be stated as “healthy” needs to be decided by the developers of the software.

This should be an endpoint that is cheap to query, so scripts (as well as monitoring) can check regularly for that endpoint to see if the ohsome API is available and “healthy”.

FabiKo117 commented 3 years ago

I assume the fastest one should be an /elements/count request regarding data-aggregation and then an /elements/bbox request regarding data-extraction. Not sure if you would require both, or just one of them.

So this would be triggered outside of the API though if I understand it correctly, right?

bonaparten commented 3 years ago

Solutions more or less out-of-the-box are Spring Boot Actuator and Dropwizard (or maybe only the Metrics library) which is customizable for working with HikariCP. Both of them offer health checks and more specific metrics. Otherwise, we can hand-code a health check.