diff --git a/app/src/main/java/io/apicurio/registry/metrics/health/liveness/PersistenceExceptionLivenessCheck.java b/app/src/main/java/io/apicurio/registry/metrics/health/liveness/PersistenceExceptionLivenessCheck.java index 35d81bc949..900cadbd5b 100644 --- a/app/src/main/java/io/apicurio/registry/metrics/health/liveness/PersistenceExceptionLivenessCheck.java +++ b/app/src/main/java/io/apicurio/registry/metrics/health/liveness/PersistenceExceptionLivenessCheck.java @@ -1,13 +1,12 @@ package io.apicurio.registry.metrics.health.liveness; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.inject.Default; -import jakarta.inject.Inject; - import io.apicurio.common.apps.config.Info; import io.apicurio.registry.metrics.health.AbstractErrorCounterHealthCheck; import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.inject.Default; +import jakarta.inject.Inject; import org.eclipse.microprofile.config.inject.ConfigProperty; import org.eclipse.microprofile.health.HealthCheck; import org.eclipse.microprofile.health.HealthCheckResponse; @@ -68,7 +67,7 @@ public synchronized HealthCheckResponse call() { return HealthCheckResponse.builder() .name("PersistenceExceptionLivenessCheck") .withData("errorCount", errorCounter) - .up() + .status(up) .build(); } diff --git a/app/src/main/java/io/apicurio/registry/metrics/health/liveness/ResponseErrorLivenessCheck.java b/app/src/main/java/io/apicurio/registry/metrics/health/liveness/ResponseErrorLivenessCheck.java index a209f25607..8b3a03be8a 100644 --- a/app/src/main/java/io/apicurio/registry/metrics/health/liveness/ResponseErrorLivenessCheck.java +++ b/app/src/main/java/io/apicurio/registry/metrics/health/liveness/ResponseErrorLivenessCheck.java @@ -1,13 +1,12 @@ package io.apicurio.registry.metrics.health.liveness; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.inject.Default; -import jakarta.inject.Inject; - import io.apicurio.common.apps.config.Info; import io.apicurio.registry.metrics.health.AbstractErrorCounterHealthCheck; import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.inject.Default; +import jakarta.inject.Inject; import org.eclipse.microprofile.config.inject.ConfigProperty; import org.eclipse.microprofile.health.HealthCheck; import org.eclipse.microprofile.health.HealthCheckResponse; @@ -66,7 +65,7 @@ public synchronized HealthCheckResponse call() { return HealthCheckResponse.builder() .name("ResponseErrorLivenessCheck") .withData("errorCount", errorCounter) - .up() + .status(up) .build(); } diff --git a/app/src/main/java/io/apicurio/registry/metrics/health/readiness/PersistenceTimeoutReadinessCheck.java b/app/src/main/java/io/apicurio/registry/metrics/health/readiness/PersistenceTimeoutReadinessCheck.java index 1bc2d4921d..4f7b80ba44 100644 --- a/app/src/main/java/io/apicurio/registry/metrics/health/readiness/PersistenceTimeoutReadinessCheck.java +++ b/app/src/main/java/io/apicurio/registry/metrics/health/readiness/PersistenceTimeoutReadinessCheck.java @@ -1,21 +1,20 @@ package io.apicurio.registry.metrics.health.readiness; -import java.time.Duration; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.inject.Default; -import jakarta.inject.Inject; - import io.apicurio.common.apps.config.Info; import io.apicurio.registry.metrics.health.AbstractErrorCounterHealthCheck; import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.inject.Default; +import jakarta.inject.Inject; import org.eclipse.microprofile.config.inject.ConfigProperty; import org.eclipse.microprofile.health.HealthCheck; import org.eclipse.microprofile.health.HealthCheckResponse; import org.eclipse.microprofile.health.Liveness; import org.slf4j.Logger; +import java.time.Duration; + /** * Fail readiness check if the duration of processing a artifactStore operation is too high. * @@ -75,7 +74,7 @@ public synchronized HealthCheckResponse call() { return HealthCheckResponse.builder() .name("PersistenceTimeoutReadinessCheck") .withData("errorCount", errorCounter) - .up() + .status(up) .build(); } diff --git a/app/src/main/java/io/apicurio/registry/metrics/health/readiness/ResponseTimeoutReadinessCheck.java b/app/src/main/java/io/apicurio/registry/metrics/health/readiness/ResponseTimeoutReadinessCheck.java index 9f174f8aa8..36a810338b 100644 --- a/app/src/main/java/io/apicurio/registry/metrics/health/readiness/ResponseTimeoutReadinessCheck.java +++ b/app/src/main/java/io/apicurio/registry/metrics/health/readiness/ResponseTimeoutReadinessCheck.java @@ -4,14 +4,6 @@ import io.apicurio.registry.metrics.health.AbstractErrorCounterHealthCheck; import jakarta.annotation.PostConstruct; -import org.eclipse.microprofile.config.inject.ConfigProperty; -import org.eclipse.microprofile.health.HealthCheck; -import org.eclipse.microprofile.health.HealthCheckResponse; -import org.eclipse.microprofile.health.Readiness; -import org.slf4j.Logger; -import java.time.Duration; -import java.time.Instant; -import java.time.format.DateTimeParseException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.inject.Default; import jakarta.enterprise.inject.Instance; @@ -21,6 +13,15 @@ import jakarta.ws.rs.container.ContainerResponseContext; import jakarta.ws.rs.container.ContainerResponseFilter; import jakarta.ws.rs.ext.Provider; +import org.eclipse.microprofile.config.inject.ConfigProperty; +import org.eclipse.microprofile.health.HealthCheck; +import org.eclipse.microprofile.health.HealthCheckResponse; +import org.eclipse.microprofile.health.Readiness; +import org.slf4j.Logger; + +import java.time.Duration; +import java.time.Instant; +import java.time.format.DateTimeParseException; /** * @author Jakub Senko m@jsenko.net @@ -95,7 +96,7 @@ public void filter(ContainerRequestContext requestContext, ContainerResponseCont log.error("Value '{}' of header '{}' is the wrong format!", requestStart, HEADER_NAME); } - } else if (responseContext.getStatus() != 404){ + } else if (responseContext.getStatus() != 404) { log.warn("Expected header '{}' not found.", HEADER_NAME); } } @@ -106,7 +107,7 @@ public synchronized HealthCheckResponse call() { return HealthCheckResponse.builder() .name("ResponseTimeoutReadinessCheck") .withData("errorCount", errorCounter) - .up() + .status(up) .build(); } }