This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 29ccb1c6932 Bump micrometer-version from 1.12.5 to 1.13.0 (#14140)
29ccb1c6932 is described below
commit 29ccb1c6932aa0646edae0245f4df41d19c844c5
Author: Claus Ibsen
AuthorDate: Tue May 14 14:25:45 2024 +0200
Bump micrometer-version from 1.12.5 to 1.13.0 (#14140)
---
.../micrometer/prometheus/MicrometerPrometheus.java | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git
a/components/camel-micrometer-prometheus/src/main/java/org/apache/camel/component/micrometer/prometheus/MicrometerPrometheus.java
b/components/camel-micrometer-prometheus/src/main/java/org/apache/camel/component/micrometer/prometheus/MicrometerPrometheus.java
index 3adf0b9fc16..833c7ba4cd1 100644
---
a/components/camel-micrometer-prometheus/src/main/java/org/apache/camel/component/micrometer/prometheus/MicrometerPrometheus.java
+++
b/components/camel-micrometer-prometheus/src/main/java/org/apache/camel/component/micrometer/prometheus/MicrometerPrometheus.java
@@ -27,9 +27,8 @@ import java.util.StringJoiner;
import io.micrometer.core.instrument.Meter;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.binder.MeterBinder;
-import io.micrometer.prometheus.PrometheusConfig;
-import io.micrometer.prometheus.PrometheusMeterRegistry;
-import io.prometheus.client.exporter.common.TextFormat;
+import io.micrometer.prometheusmetrics.PrometheusConfig;
+import io.micrometer.prometheusmetrics.PrometheusMeterRegistry;
import io.vertx.core.Handler;
import io.vertx.core.http.HttpMethod;
import io.vertx.ext.web.Route;
@@ -73,6 +72,9 @@ public class MicrometerPrometheus extends ServiceSupport
implements CamelMetrics
private static final Logger LOG =
LoggerFactory.getLogger(MicrometerPrometheus.class);
+private static final String CONTENT_TYPE_004 = "text/plain; version=0.0.4;
charset=utf-8";
+private static final String CONTENT_TYPE_100 =
"application/openmetrics-text; version=1.0.0; charset=utf-8";
+
private MainHttpServer server;
private VertxPlatformHttpRouter router;
private PlatformHttpComponent platformHttpComponent;
@@ -389,7 +391,7 @@ public class MicrometerPrometheus extends ServiceSupport
implements CamelMetrics
metrics.method(HttpMethod.GET);
final String format
-= "0.0.4".equals(textFormatVersion) ?
TextFormat.CONTENT_TYPE_004 : TextFormat.CONTENT_TYPE_OPENMETRICS_100;
+= "0.0.4".equals(textFormatVersion) ? CONTENT_TYPE_004 :
CONTENT_TYPE_100;
metrics.produces(format);
Handler handler = new Handler() {
@@ -399,7 +401,7 @@ public class MicrometerPrometheus extends ServiceSupport
implements CamelMetrics
// the client may ask for version 1.0.0 via accept header
String ah = ctx.request().getHeader("Accept");
if (ah != null && ah.contains("application/openmetrics-text"))
{
-ct = TextFormat.chooseContentType(ah);
+ct = CONTENT_TYPE_100;
}
ctx.response().putHeader("Content-Type", ct);