Search in sources :

Example 1 with PrometheusClientServiceConfiguration

use of uk.gov.ida.hub.config.configuration.PrometheusClientServiceConfiguration in project verify-hub by alphagov.

the class PrometheusClientService method createCertificateExpiryDateCheckMetrics.

public void createCertificateExpiryDateCheckMetrics() {
    final PrometheusClientServiceConfiguration configuration = configConfiguration.getCertificateExpiryDateCheckServiceConfiguration();
    if (configuration.getEnable()) {
        Gauge expiryDateGauge = Gauge.build(VERIFY_CONFIG_CERTIFICATE_EXPIRY_DATE, VERIFY_CONFIG_CERTIFICATE_EXPIRY_DATE_HELP).labelNames("entity_id", "use", "subject", "fingerprint", "serial").register();
        Gauge lastUpdatedGauge = Gauge.build(VERIFY_CONFIG_CERTIFICATE_EXPIRY_DATE_LAST_UPDATED, VERIFY_CONFIG_CERTIFICATE_EXPIRY_DATE_LAST_UPDATED_HELP).register();
        CertificateExpiryDateCheckService certificateExpiryDateCheckService = new CertificateExpiryDateCheckService(certificateService, expiryDateGauge, lastUpdatedGauge);
        createScheduledExecutorService(configuration, VERIFY_CONFIG_CERTIFICATE_EXPIRY_DATE, certificateExpiryDateCheckService);
    }
}
Also used : PrometheusClientServiceConfiguration(uk.gov.ida.hub.config.configuration.PrometheusClientServiceConfiguration) Gauge(io.prometheus.client.Gauge)

Example 2 with PrometheusClientServiceConfiguration

use of uk.gov.ida.hub.config.configuration.PrometheusClientServiceConfiguration in project verify-hub by alphagov.

the class PrometheusClientService method createCertificateOcspRevocationStatusCheckMetrics.

public void createCertificateOcspRevocationStatusCheckMetrics() {
    final PrometheusClientServiceConfiguration configuration = configConfiguration.getCertificateOcspRevocationStatusCheckServiceConfiguration();
    if (configuration.getEnable()) {
        Gauge ocspStatusGauge = Gauge.build(VERIFY_CONFIG_CERTIFICATE_OCSP_REVOCATION_STATUS, VERIFY_CONFIG_CERTIFICATE_OCSP_REVOCATION_STATUS_HELP).labelNames("entity_id", "use", "subject", "fingerprint", "serial").register();
        Gauge lastUpdatedGauge = Gauge.build(VERIFY_CONFIG_CERTIFICATE_OCSP_LAST_SUCCESS_TIMESTAMP, VERIFY_CONFIG_CERTIFICATE_OCSP_LAST_SUCCESS_TIMESTAMP_HELP).labelNames("entity_id", "use", "subject", "fingerprint", "serial").register();
        OcspCertificateChainValidationService ocspCertificateChainValidationService = new OcspCertificateChainValidationService(ocspCertificateChainValidityChecker, certificateService, ocspStatusGauge, lastUpdatedGauge);
        createScheduledExecutorService(configuration, VERIFY_CONFIG_CERTIFICATE_OCSP_REVOCATION_STATUS, ocspCertificateChainValidationService);
    }
}
Also used : PrometheusClientServiceConfiguration(uk.gov.ida.hub.config.configuration.PrometheusClientServiceConfiguration) Gauge(io.prometheus.client.Gauge)

Aggregations

Gauge (io.prometheus.client.Gauge)2 PrometheusClientServiceConfiguration (uk.gov.ida.hub.config.configuration.PrometheusClientServiceConfiguration)2