Health Check Spring Boot
However you can add your own health indicator.
Health check spring boot. The health check provided by a datasource creates a connection to a database and performs a simple query such as select 1 from dual to check that it is working. Understanding spring boot s health check indicators. Spring boot actuator module helps you monitor and manage your spring boot application by providing production ready features like health check up auditing metrics gathering http tracing etc.
Check out the course. Writing custom health adaptor for each of these resources. I just announced the new learn spring course focused on the fundamentals of spring 5 and spring boot 2.
Spring boot provides bunch of ready to use health indicators. Spring boot aggregates all health indicators it finds in the application context to create the result of the health endpoint we have seen above. Out of the box spring boot registers many healthindicators to report the healthiness of a particular application aspect.
It would involve checking various aspects of an application like database disk space or even connectivity to another web service. Some of the predefined indicators are datasourcehealthindicator diskspacehealthindicator mongohealthindicator redishealthindicator cassandrahealthindicator etc. Spring boot s out of the box health checks are good.
As an example lets consider your application talks to service a which is up and service b which is down. Learn all about health indicators in spring boot. All of these features can be accessed over jmx or http endpoints.
Add custom heath checks. In this case it would be helpful to add a health indicator for the downstream systems just like a database or a file system health check. For the same you need to implement healthindicator interface.