Search in sources :

Example 1 with MatchingServiceHealthCheckService

use of uk.gov.ida.hub.samlsoapproxy.service.MatchingServiceHealthCheckService 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);
    }
}
Also used : MatchingServiceInfoMetric(uk.gov.ida.hub.samlsoapproxy.service.MatchingServiceInfoMetric) SynchronousQueue(java.util.concurrent.SynchronousQueue) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) ExecutorService(java.util.concurrent.ExecutorService) ThreadFactoryBuilder(com.google.common.util.concurrent.ThreadFactoryBuilder) PrometheusClientServiceConfiguration(uk.gov.ida.hub.samlsoapproxy.config.PrometheusClientServiceConfiguration) MatchingServiceHealthCheckService(uk.gov.ida.hub.samlsoapproxy.service.MatchingServiceHealthCheckService) Gauge(io.prometheus.client.Gauge)

Aggregations

ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)1 Gauge (io.prometheus.client.Gauge)1 ExecutorService (java.util.concurrent.ExecutorService)1 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)1 SynchronousQueue (java.util.concurrent.SynchronousQueue)1 PrometheusClientServiceConfiguration (uk.gov.ida.hub.samlsoapproxy.config.PrometheusClientServiceConfiguration)1 MatchingServiceHealthCheckService (uk.gov.ida.hub.samlsoapproxy.service.MatchingServiceHealthCheckService)1 MatchingServiceInfoMetric (uk.gov.ida.hub.samlsoapproxy.service.MatchingServiceInfoMetric)1