Helidon SE Helpings: Show Details For Health Endpoint
With Helidon SE you can add a health endpoint to your application by simply adding a dependency. In your pom.xml
you have to add the dependency io.helidon.webserver.observe:helidon-webserver-observe-health
. This adds a new endpoint /health
to your application. When your application is up and running the /health
endpoint will return the HTTP status code 204 with an empty body. If your application is not healthy then the HTTP status code 503 is returned. In case of an error an HTTP status code 500 is sent to the client.
If you want to see a response with details then you need to set the configuration property server.features.observe.observers.health.details
to the value true
. Instead of the HTTP status code 204 the status code 200 is returned when our application is healthy. The response contains a JSON object with a status
field with the value UP
for a healthy response. The response also contains the field checks
with an array of detailed information from health checks that are available in our application.