spring-boot-admin icon indicating copy to clipboard operation
spring-boot-admin copied to clipboard

health-check-only mode for discovered services

Open lucwillems opened this issue 6 years ago • 5 comments

after upgrade to 2.1.1 release i notice a change in how none spring-boot application registered with consul are handled. in my case, consul was also registered as a service, and in SBA 2.0.4 this was shown as a gray "offline" service.

upgrading to 2.1.1 i had to add consul to the list of ignored-services because SBA was trying to collect /actuator information which is not available. this also remove the service from the overview/wallboard making it invisible, as it was not there.

i't would be nice to have some way to show none spring-boot applications as well into the total overview but using the consul status for "offline/online" status, and not use /actuator for this service if this fails. this allows the wallboard to be a general status page which can be show as overview of the "cloud services"

beside the spring boot based services, we also have some none spring services like nats/consul/jaeger. so showing them as well would greatly improve the overview of the wallboard.

lucwillems avatar Jan 01 '19 10:01 lucwillems

after upgrade to 2.1.1 release i notice a change in how none spring-boot application registered with consul are handled. in my case, consul was also registered as a service, and in SBA 2.0.4 this was shown as a gray "offline" service.

upgrading to 2.1.1 i had to add consul to the list of ignored-services because SBA was trying to collect /actuator information which is not available. this also remove the service from the overview/wallboard making it invisible, as it was not there.

We didn't change the way the discovered instances are handled in the recent releases. And the ability to exclude services by pattern is pretty old (but is not by default active).

i't would be nice to have some way to show none spring-boot applications as well into the total overview but using the consul status for "offline/online" status, and not use /actuator for this service if this fails. this allows the wallboard to be a general status page which can be show as overview of the "cloud services"

You could write subclass own DeaultServiceInstanceConverter and remove the management url for those services you want just to be health checked (e.g. triggered via metadata). Unfortunately we can't take the health information from consul as the ServiceInstance interface doesn't expose such information - but you could add a metadata entry with the key health.path to the service registration so this custom address is health checked (just needs to deliver a 200 OK http response)

joshiste avatar Jan 02 '19 14:01 joshiste

In summary the only enhancement we could reasonably to in SBA is to add the option to just health-check specific services if the have certain metadata.

joshiste avatar Jan 02 '19 14:01 joshiste

seems reasonable. i'm currently in the progress of moving ALL my none spring services into the consul service catalog using containerPilot. it allows to set tags/metadata so SBA can do the checks. only thing is that for example , mysql, will not have a HTTP based health check. the health is checked by containerPilot , which updates the consul status based on the result of this periodic health check. in this case SBA should not perform a HTTP based health check. so if no we have a a metadata flag like sba.health.disable=true , we could skip this ?

lucwillems avatar Jan 06 '19 07:01 lucwillems

in this case SBA should not perform a HTTP based health check. so if no we have a a metadata flag like sba.health.disable=true , we could skip this ?

@lucwillems what would be the benefit of having the instance listed (but not health-checked)?

joshiste avatar Jan 07 '19 08:01 joshiste

@joshiste the health check is done by containerPilot which will manage the service entry in consul. it uses consul TTL for the service check , so if check fails to update the service entry before TTL expires , consul will mark the service as "bad" removed it after TTL. if SBA can't do the health check it should rely/expect that external tools manage the status.

lucwillems avatar Jan 07 '19 13:01 lucwillems