From 21ac5fc6dadd08db7140774478703bc40b1d075d Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Thu, 8 Aug 2024 15:18:07 +0300 Subject: [PATCH] Use marker annotations for static/runtime init in MicrometerRecorder --- .../io/quarkus/micrometer/runtime/MicrometerRecorder.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/MicrometerRecorder.java b/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/MicrometerRecorder.java index d500a274f7a59..d80a9054a1335 100644 --- a/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/MicrometerRecorder.java +++ b/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/MicrometerRecorder.java @@ -42,6 +42,8 @@ import io.quarkus.runtime.RuntimeValue; import io.quarkus.runtime.ShutdownContext; import io.quarkus.runtime.annotations.Recorder; +import io.quarkus.runtime.annotations.RuntimeInit; +import io.quarkus.runtime.annotations.StaticInit; import io.quarkus.runtime.metrics.MetricsFactory; @Recorder @@ -52,7 +54,7 @@ public class MicrometerRecorder { public static String nonApplicationUri = "/q/"; public static String httpRootUri = "/"; - /* STATIC_INIT */ + @StaticInit public RuntimeValue createRootRegistry(MicrometerConfig config, String qUri, String httpUri) { factory = new MicrometerMetricsFactory(config, Metrics.globalRegistry); nonApplicationUri = qUri; @@ -60,7 +62,7 @@ public RuntimeValue createRootRegistry(MicrometerConfig config, S return new RuntimeValue<>(Metrics.globalRegistry); } - /* RUNTIME_INIT */ + @RuntimeInit public void configureRegistries(MicrometerConfig config, Set> registryClasses, ShutdownContext context) { @@ -263,7 +265,7 @@ static String getExceptionTag(Throwable throwable) { return throwable.getCause().getClass().getSimpleName(); } - /* RUNTIME_INIT */ + @RuntimeInit public RuntimeValue configureHttpMetrics( boolean httpServerMetricsEnabled, boolean httpClientMetricsEnabled,