From 542e93b2edd46bbbef0bb350ad6f656be00d0c67 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Wed, 13 Dec 2023 10:25:40 +0200 Subject: [PATCH] Use NoStackTraceException in metrics This is done because the stacktrace produced is completely useless and only makes it harder to focus on the real problem Relates to: https://github.com/quarkiverse/quarkus-langchain4j/issues/140 --- .../runtime/binder/vertx/VertxMeterBinderAdapter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/binder/vertx/VertxMeterBinderAdapter.java b/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/binder/vertx/VertxMeterBinderAdapter.java index e3a4b7de2a890..384f10ed0bc43 100644 --- a/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/binder/vertx/VertxMeterBinderAdapter.java +++ b/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/binder/vertx/VertxMeterBinderAdapter.java @@ -10,6 +10,7 @@ import io.vertx.core.datagram.DatagramSocketOptions; import io.vertx.core.http.HttpClientOptions; import io.vertx.core.http.HttpServerOptions; +import io.vertx.core.impl.NoStackTraceException; import io.vertx.core.metrics.MetricsOptions; import io.vertx.core.net.NetClientOptions; import io.vertx.core.net.NetServerOptions; @@ -60,7 +61,7 @@ public MetricsOptions newOptions() { @Override public HttpServerMetrics createHttpServerMetrics(HttpServerOptions options, SocketAddress localAddress) { if (httpBinderConfiguration == null) { - throw new IllegalStateException("HttpBinderConfiguration was not found"); + throw new NoStackTraceException("HttpBinderConfiguration was not found"); } if (httpBinderConfiguration.isServerEnabled()) { log.debugf("Create HttpServerMetrics with options %s and address %s", options, localAddress);