org.springframework.boot.actuate.health.HealthAggregator Java Examples

The following examples show how to use org.springframework.boot.actuate.health.HealthAggregator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PipelineController.java    From kayenta with Apache License 2.0 6 votes vote down vote up
@Autowired
public PipelineController(
    ExecutionLauncher executionLauncher,
    ExecutionRepository executionRepository,
    ObjectMapper kayentaObjectMapper,
    ConfigurableApplicationContext context,
    HealthIndicatorRegistry healthIndicators,
    HealthAggregator healthAggregator,
    ScheduledAnnotationBeanPostProcessor postProcessor) {
  this.executionLauncher = executionLauncher;
  this.executionRepository = executionRepository;
  this.kayentaObjectMapper = kayentaObjectMapper;
  this.context = context;
  this.healthIndicator = new CompositeHealthIndicator(healthAggregator, healthIndicators);
  this.postProcessor = postProcessor;
}
 
Example #2
Source File: HealthMetricsConfiguration.java    From summerframework with Apache License 2.0 5 votes vote down vote up
public HealthMetricsConfiguration(HealthAggregator healthAggregator, List<HealthIndicator> healthIndicators,
    MeterRegistry registry, PlatformTag platformTag) {
    healthIndicator = new CompositeHealthIndicator(healthAggregator);
    healthIndicators.forEach(h -> {
        registry.gauge("health." + h.getClass().getSimpleName().replace("HealthIndicator", "").toLowerCase(),
            platformTag.getTags(), h, HealthMetricsConfiguration::getStatusCode);
        healthIndicator.addHealthIndicator(h.toString(), h);
    });
    registry.gauge("health", platformTag.getTags(), healthIndicator, HealthMetricsConfiguration::getStatusCode);
}
 
Example #3
Source File: AdvancedDiskSpaceHealthIndicator.java    From super-cloudops with Apache License 2.0 5 votes vote down vote up
@Bean(BEAN_NAME)
public HealthIndicator diskSpaceHealthIndicator(HealthAggregator healthAggregator, DiskSpaceHealthProperties conf) {
	if (logger.isInfoEnabled())
		logger.info("Initial diskSpaceHealthIndicator. {}", conf);

	AdvancedDiskSpaceHealthIndicator healthIndicator = new AdvancedDiskSpaceHealthIndicator(conf);
	Map<String, Health> healths = new LinkedHashMap<String, Health>();
	healths.put(AdvancedDiskSpaceHealthIndicator.class.getSimpleName(), healthIndicator.health());
	return healthIndicator;
}
 
Example #4
Source File: TimeoutsHealthIndicator.java    From super-cloudops with Apache License 2.0 5 votes vote down vote up
@Bean
public HealthIndicator timeoutsHealthIndicator(HealthAggregator healthAggregator, TimerMetricsProperties conf) {
	if (conf.getSamples() == 0)
		throw new IllegalArgumentException("Latest measure count is 0.");
	if (logger.isInfoEnabled())
		logger.info("Initial timeoutsHealthIndicator. {}", conf);

	TimeoutsHealthIndicator healthIndicator = new TimeoutsHealthIndicator(conf);
	Map<String, Health> healths = new LinkedHashMap<String, Health>();
	healths.put(TimeoutsHealthIndicator.class.getSimpleName(), healthIndicator.health());
	return healthIndicator;
}
 
Example #5
Source File: AdvancedMemoryHealthIndicator.java    From super-cloudops with Apache License 2.0 5 votes vote down vote up
@Bean(BEAN_NAME)
public HealthIndicator memoryHealthIndicator(HealthAggregator healthAggregator, MemoryHealthProperties conf) {
	if (logger.isInfoEnabled())
		logger.info("Initial memoryHealthIndicator. {}", conf);

	AdvancedMemoryHealthIndicator healthIndicator = new AdvancedMemoryHealthIndicator(conf);
	Map<String, Health> healths = new LinkedHashMap<String, Health>();
	healths.put(AdvancedMemoryHealthIndicator.class.getSimpleName(), healthIndicator.health());
	return healthIndicator;
}
 
Example #6
Source File: AdvancedCpuHealthIndicator.java    From super-cloudops with Apache License 2.0 5 votes vote down vote up
@Bean(BEAN_NAME)
public HealthIndicator coreHealthIndicator(HealthAggregator healthAggregator, CpuHealthProperties conf) {
	if (logger.isInfoEnabled())
		logger.info("Initial CoreHealthIndicator. {}", conf);

	AdvancedCpuHealthIndicator healthIndicator = new AdvancedCpuHealthIndicator(conf);
	Map<String, Health> healths = new LinkedHashMap<String, Health>();
	healths.put(AdvancedCpuHealthIndicator.class.getSimpleName(), healthIndicator.health());
	return healthIndicator;
}
 
Example #7
Source File: EurekaComponents.java    From kork with Apache License 2.0 5 votes vote down vote up
@Bean
HealthCheckHandler healthCheckHandler(
    ApplicationInfoManager applicationInfoManager,
    HealthAggregator healthAggregator,
    Map<String, HealthIndicator> healthIndicators) {
  return new BootHealthCheckHandler(applicationInfoManager, healthAggregator, healthIndicators);
}
 
Example #8
Source File: BootHealthCheckHandler.java    From kork with Apache License 2.0 5 votes vote down vote up
public BootHealthCheckHandler(
    ApplicationInfoManager applicationInfoManager,
    HealthAggregator aggregator,
    Map<String, HealthIndicator> healthIndicators) {
  this.applicationInfoManager =
      Objects.requireNonNull(applicationInfoManager, "applicationInfoManager");
  this.aggregateHealth = new CompositeHealthIndicator(aggregator, healthIndicators);
}
 
Example #9
Source File: MicrometerAutoConfiguration.java    From summerframework with Apache License 2.0 4 votes vote down vote up
@Bean
public HealthMetricsConfiguration healthMetricsConfiguration(HealthAggregator healthAggregator,
    List<HealthIndicator> healthIndicators, MeterRegistry registry, PlatformTag platformTag) {
    return new HealthMetricsConfiguration(healthAggregator, healthIndicators, registry, platformTag);
}
 
Example #10
Source File: ZipkinServerConfiguration.java    From pivotal-bank-demo with Apache License 2.0 4 votes vote down vote up
/** Registers health for any components, even those not in this jar. */
@Bean
ZipkinHealthIndicator zipkinHealthIndicator(HealthAggregator healthAggregator) {
  return new ZipkinHealthIndicator(healthAggregator);
}
 
Example #11
Source File: ZipkinHealthIndicator.java    From pivotal-bank-demo with Apache License 2.0 4 votes vote down vote up
ZipkinHealthIndicator(HealthAggregator healthAggregator) {
  super(healthAggregator);
}
 
Example #12
Source File: ZipkinServerConfigurationTest.java    From pivotal-bank-demo with Apache License 2.0 4 votes vote down vote up
@Bean
public HealthAggregator healthAggregator() {
  return new OrderedHealthAggregator();
}