This is a follow-up of https://github.com/spring-projects/spring-boot/issues/18194#issuecomment-539337300
In the related PR, the code that is required to get the overall status in 2.2 is more involved than it used to be with 2.1.
Comment From: onobc
@snicoll
What are your thoughts about adding @Configuration
w/ @ConditionalOnProperty
that exposes this overall health as a Gauge - basically take the code from the doc and guard it w/ the conditional. We would have to allow customization of the mapped status codes. Also, it only support single health indicators.
Another thought is to have a higher level abstraction for the metric provider - a bean/class like https://github.com/micrometer-metrics/micrometer-docs/pull/100/files#diff-5337bb90e2bfbdc9b9194632ce5ee82aR61 - but also add support for composites.
I would not mind working this ticket.
Comment From: snicoll
@bono007 Thanks for the suggestion. I personally think we need to craft the API in such a way that computing the overall status is as easy as before. Anything in between where we take that complexity on our side is hiding the underlying problem (if there is one) IMO. I haven't looked in more details so can't say right now but I'd rather rework the API.
Comment From: philwebb
I fixed the Micrometer documentation by injecting the HealthEndpoint
and using that directly (see #18329). I'll close this one for now unless that approach turns out to be too limited.