Q:

Disabling customer health check - Hystrix

Is there a way to disable the below listed custom health check for hystrix -
@Component
@ConditionalOnClass(name = "org.springframework.cloud.netflix.hystrix.HystrixHealthIndicator")
public class XspHystrixHealthIndicator extends AbstractHealthIndicator {

When I check localhost:8080/health , I see the below
{
"status": "UP",
"xspHystrix": {
"status": "UP"
},
"manualSwitch": {
"status": "UP"
},
"redis": {
"status": "UP",
"version": "3.0.7"
},
"hystrix": {
"status": "UP"
}
}

I don't want xspHystrix and hystrix to be listed and they shouldn't be part of health check. 
I add the below property and don't see hystrix any longer but I still see xspHystrix which I don't want to be displayed -
management:
  health:
    hystrix:
      enabled: false
    xspHystrix:
      enabled: false

A:

No, you can't do it without changing your code of XspHystrixHealthIndicator.java. 
Spring Boot health actuator aggregates all Spring beans that implement HealthIndicator. If you put your XspHystrixHealthIndicator in component scan path, it will be aggregated into Health actuator.
If you can change XspHystrixHealthIndicator.java, please try the below.
First, remove @Component and @ConditionalOnClass from XspHystrixHealthIndicator. And then make your own configuration class that will load your XspHystrixHealthIndicator bean based on properties. It might look like something below. 
@Configuration
@ConditionalOnClass(name = "org.springframework.cloud.netflix.hystrix.HystrixHealthIndicator")
public class XpsHystrixAutoConfiguration {   
    @Bean
    @ConditionalOnEnabledHealthIndicator("xspHystrix")
    public XspHystrixHealthIndicator xpsHystrixHealthIndicator() {
        return new XspHystrixHealthIndicator();
    }  
}

