This is an automated email from the ASF dual-hosted git repository. pcongiusti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 792cfb8fb701aafe9f3b3fbbfee7320a0a615881 Author: Pasquale Congiusti <pasquale.congiu...@gmail.com> AuthorDate: Mon Mar 3 11:11:10 2025 +0100 feat(dsl/jbang): Run --observe to replace --metrics and --health --- .../java/org/apache/camel/dsl/jbang/core/commands/Run.java | 13 +++++++++++-- .../src/main/java/org/apache/camel/main/KameletMain.java | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java index bc6fefce3a2..2f0205b3f64 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java @@ -287,13 +287,18 @@ public class Run extends CamelCommand { @Option(names = { "--console" }, description = "Developer console at /q/dev on local HTTP server (port 8080 by default)") boolean console; - @Option(names = { "--health" }, description = "Health check at /q/health on local HTTP server (port 8080 by default)") + @Option(names = { "--health" }, + description = "Deprecated: use --observe instead. Health check at /q/health on local HTTP server (port 8080 by default)") boolean health; @Option(names = { "--metrics" }, - description = "Metrics (Micrometer and Prometheus) at /q/metrics on local HTTP server (port 8080 by default)") + description = "Deprecated: use --observe instead. Metrics (Micrometer and Prometheus) at /q/metrics on local HTTP server (port 8080 by default)") boolean metrics; + @Option(names = { "--observe" }, + description = "Enable observability services") + boolean observe; + @Option(names = { "--modeline" }, defaultValue = "true", description = "Deprecated, to be removed: Enables Camel-K style modeline") boolean modeline = true; @@ -606,6 +611,10 @@ public class Run extends CamelCommand { writeSetting(main, profileProperties, "camel.jbang.quarkusGroupId", quarkusGroupId); writeSetting(main, profileProperties, "camel.jbang.quarkusArtifactId", quarkusArtifactId); + if (observe) { + main.addInitialProperty("camel.jbang.dependencies", "camel:observability-services"); + } + // command line arguments if (property != null) { for (String p : property) { diff --git a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/KameletMain.java b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/KameletMain.java index c975b3d2c90..2a443b91d34 100644 --- a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/KameletMain.java +++ b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/KameletMain.java @@ -538,12 +538,14 @@ public class KameletMain extends MainCommandLineSupport { configure().httpServer().withEnabled(true); configure().httpServer().withInfoEnabled(true); } + // Deprecated: to be replaced by observe flag boolean health = "true".equals(getInitialProperties().get(getInstanceType() + ".health")); if (health) { configure().health().withEnabled(true); configure().httpServer().withEnabled(true); configure().httpServer().withHealthCheckEnabled(true); } + // Deprecated: to be replaced by observe flag boolean metrics = "true".equals(getInitialProperties().get(getInstanceType() + ".metrics")); if (metrics) { configure().metrics()