I want to report the health status of the application as a gauge and I desired to use the same health indicators as spring-boot-actuator, however, I don't see any exportable components from the spring-boot-actuator dependency that I might be able to use here.
The code I would like to write:
@Component
public class HealthCounterMetric {
private final Counter statusCounter;
public HealthCounterMetric(MeterRegistry meterRegistry, SystemHealth systemHealth) {
this.statusCounter = meterRegistry.counter("service.status");
}
@Scheduled(fixedRate = 30000L)
public void reportHealth() {
//do report health
}
}
Of course, SystemHealth is not an exported bean. Does spring boot actuator export beans that I can consume this way?