Search in sources :

Example 1 with IndyHealthCheckRegistrySet

use of org.commonjava.indy.metrics.healthcheck.IndyHealthCheckRegistrySet in project indy by Commonjava.

the class IndyMetricsManager method initMetric.

@PostConstruct
public void initMetric() {
    if (!config.isMetricsEnabled())
        return;
    IndyJVMInstrumentation.init(metricRegistry);
    IndyHealthCheckRegistrySet healthCheckRegistrySet = new IndyHealthCheckRegistrySet();
    indyMetricsHealthChecks.forEach(indyHealthCheck -> {
        healthCheckRegistrySet.register(indyHealthCheck.getName(), (HealthCheck) indyHealthCheck);
    });
    try {
        metricRegistry.register(healthCheckRegistrySet.getName(), healthCheckRegistrySet);
        reporter.initReporter(metricRegistry);
    } catch (Exception e) {
        logger.error(e.getMessage());
        throw new RuntimeException(e);
    }
}
Also used : IndyHealthCheckRegistrySet(org.commonjava.indy.metrics.healthcheck.IndyHealthCheckRegistrySet) PostConstruct(javax.annotation.PostConstruct)

Aggregations

PostConstruct (javax.annotation.PostConstruct)1 IndyHealthCheckRegistrySet (org.commonjava.indy.metrics.healthcheck.IndyHealthCheckRegistrySet)1