From ba54a59f152a729994826ecb74b7c6de5ad719ad Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Tue, 23 May 2023 14:19:09 +0300 Subject: [PATCH] Properly include Prometheus related code The way the test was being done previously was checking the build time classpath instead of the runtime class for the presence of the Prometheus Registry. Fixes: #33547 (cherry picked from commit a42d2de0e791951288cab8507b36bcd14061ab56) --- .../deployment/export/PrometheusRegistryProcessor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/micrometer/deployment/src/main/java/io/quarkus/micrometer/deployment/export/PrometheusRegistryProcessor.java b/extensions/micrometer/deployment/src/main/java/io/quarkus/micrometer/deployment/export/PrometheusRegistryProcessor.java index 4fcd30d4ce294..10ed43b3dca42 100644 --- a/extensions/micrometer/deployment/src/main/java/io/quarkus/micrometer/deployment/export/PrometheusRegistryProcessor.java +++ b/extensions/micrometer/deployment/src/main/java/io/quarkus/micrometer/deployment/export/PrometheusRegistryProcessor.java @@ -39,7 +39,8 @@ public static class PrometheusEnabled implements BooleanSupplier { MicrometerConfig mConfig; public boolean getAsBoolean() { - return REGISTRY_CLASS != null && mConfig.checkRegistryEnabledWithDefault(mConfig.export.prometheus); + return (REGISTRY_CLASS != null) && QuarkusClassLoader.isClassPresentAtRuntime(REGISTRY_CLASS_NAME) + && mConfig.checkRegistryEnabledWithDefault(mConfig.export.prometheus); } }