Is there any way to support multiple health endpoints on a Spring Boot application?
Here's why: The standard actuator health check is great, built in checks are great, customization options are great - for a single use case: reporting on general application health.
But I'd like something I can call from an AWS Elastic Load Balancer / AutoScaling Group. By default, if an instance fails a health check, the ELB/ASG will terminate it and replace it with a fresh instance. The problem is some of the health checks, like DataSourceHealthIndicator, will report DOWN if the database is down, but my application instance is otherwise perfectly healthy. If I use the default behavior, AWS will throw out perfectly healthy instances until the database comes back up, and this will run up my bill.
I could get rid of the DataSourceHealthIndicator, but I like having it around for general health checking purposes. So what I really want is two separate endpoints for two different purposes, such as:
/health - General application health /ec2Health - Ignores aspects unrelated to the EC2 instance, such as a DB outage.
Hope that makes sense.