This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch mm in repository https://gitbox.apache.org/repos/asf/camel.git
commit 5e5a98c6947d55f0b77e71cfd379a6c6f1340038 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu Nov 16 15:37:57 2023 +0100 CAMEL-20105: camel-micromemter - Make it easier to configure for camel-main --- .../src/main/docs/micrometer-prometheus.adoc | 31 ++++++++++++++++++++++ .../prometheus/MicrometerPrometheus.java | 3 --- .../src/test/resources/log4j2.properties | 28 ------------------- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/components/camel-micrometer-prometheus/src/main/docs/micrometer-prometheus.adoc b/components/camel-micrometer-prometheus/src/main/docs/micrometer-prometheus.adoc new file mode 100644 index 00000000000..e558d9901a3 --- /dev/null +++ b/components/camel-micrometer-prometheus/src/main/docs/micrometer-prometheus.adoc @@ -0,0 +1,31 @@ += Micrometer Prometheus Component +:doctitle: Micrometer Prometheus +:shortname: micrometer-prometheus +:artifactid: camel-micrometer-prometheus +:description: Camel Micrometer Prometheus for Camel Main +:since: 4.3 +:supportlevel: Preview +:tabs-sync-option: + +*Since Camel {since}* + +The camel-micrometer-prometheus is used for running Camel standalone (camel-main) and integrate with Micrometer Prometheus Registry. + +== Auto-detection from classpath + +To use this implementation all you need to do is to add the `camel-micrometer-prometheus` dependency to the classpath, +and turn on metrics in `application.properties` such as: + +[source,properties] +---- +# enable HTTP server with metrics +camel.server.enabled=true +camel.server.metricsEnabled=true + +# turn on micrometer metrics +camel.metrics.enabled=true +# include more camel details +camel.metrics.enableMessageHistory=true +# include additional out-of-the-box micrometer metrics for cpu, jvm and used file descriptors +camel.metrics.binders=processor,jvm-info,file-descriptor +---- 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 cb04572ad60..a37ad11185f 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 @@ -70,9 +70,6 @@ public class MicrometerPrometheus extends ServiceSupport implements CamelMetrics private VertxPlatformHttpRouter router; private PlatformHttpComponent platformHttpComponent; - // TODO: include easily with jbang - // TODO: docs - private CamelContext camelContext; private final PrometheusMeterRegistry meterRegistry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT); private final Set<MeterBinder> createdBinders = new HashSet<>(); diff --git a/components/camel-micrometer-prometheus/src/test/resources/log4j2.properties b/components/camel-micrometer-prometheus/src/test/resources/log4j2.properties deleted file mode 100644 index f24ae625ca1..00000000000 --- a/components/camel-micrometer-prometheus/src/test/resources/log4j2.properties +++ /dev/null @@ -1,28 +0,0 @@ -## --------------------------------------------------------------------------- -## Licensed to the Apache Software Foundation (ASF) under one or more -## contributor license agreements. See the NOTICE file distributed with -## this work for additional information regarding copyright ownership. -## The ASF licenses this file to You under the Apache License, Version 2.0 -## (the "License"); you may not use this file except in compliance with -## the License. You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. -## --------------------------------------------------------------------------- - -appender.file.type = File -appender.file.name = file -appender.file.fileName = target/camel-test-micrometer-prometheus.log -appender.file.layout.type = PatternLayout -appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n -appender.out.type = Console -appender.out.name = out -appender.out.layout.type = PatternLayout -appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n -rootLogger.level = INFO -rootLogger.appenderRef.file.ref = file