use of uk.gov.ida.hub.samlsoapproxy.config.PrometheusClientServiceConfiguration in project verify-hub by alphagov.
the class PrometheusClient method createMatchingServiceHealthCheckMetrics.
public void createMatchingServiceHealthCheckMetrics() {
final PrometheusClientServiceConfiguration configuration = samlSoapProxyConfiguration.getMatchingServiceHealthCheckServiceConfiguration();
if (configuration.getEnable()) {
Gauge healthStatusGauge = Gauge.build(VERIFY_SAML_SOAP_PROXY_MSA_HEALTH_STATUS, VERIFY_SAML_SOAP_PROXY_MSA_HEALTH_STATUS_HELP).labelNames("matchingService").register();
Gauge healthStatusLastUpdatedGauge = Gauge.build(VERIFY_SAML_SOAP_PROXY_MSA_HEALTH_STATUS_LAST_UPDATED, VERIFY_SAML_SOAP_PROXY_MSA_HEALTH_STATUS_LAST_UPDATED_HELP).labelNames("matchingService").register();
MatchingServiceInfoMetric infoMetric = new MatchingServiceInfoMetric().register();
ExecutorService matchingServiceHealthCheckTaskManager = environment.lifecycle().executorService(MSA_HEALTH_CHECK_TASK_MANAGER).threadFactory(new ThreadFactoryBuilder().setNameFormat(MSA_HEALTH_CHECK_TASK_MANAGER).setDaemon(USE_DAEMON_THREADS).build()).minThreads(configuration.getMinNumOfThreads()).maxThreads(configuration.getMaxNumOfThreads()).keepAliveTime(configuration.getKeepAliveTime()).workQueue(new SynchronousQueue<>()).build();
MatchingServiceHealthCheckService matchingServiceHealthCheckService = new MatchingServiceHealthCheckService(matchingServiceHealthCheckTaskManager, samlSoapProxyConfiguration.getHealthCheckSoapHttpClient().getTimeout(), matchingServiceConfigProxy, matchingServiceHealthChecker, healthStatusGauge, healthStatusLastUpdatedGauge, infoMetric);
createScheduledExecutorService(configuration, VERIFY_SAML_SOAP_PROXY_MSA_HEALTH_STATUS, matchingServiceHealthCheckService);
}
}
Aggregations