This is an automated email from the ASF dual-hosted git repository.

squakez pushed a commit to branch feat/CAMEL-24356
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 9d4770c190d8552577847a9e9993b6eb98b62e12
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Mon Aug 10 15:23:24 2026 +0200

    chore(core): logMetricsOnShutdownFormat field setting
    
    Ref CAMEL-24356
---
 .../MetricsConfigurationPropertiesConfigurer.java   |  7 +++++++
 .../META-INF/camel-main-configuration-metadata.json |  1 +
 core/camel-main/src/main/docs/main.adoc             |  3 ++-
 .../camel/main/MetricsConfigurationProperties.java  | 21 +++++++++++++++++++++
 4 files changed, 31 insertions(+), 1 deletion(-)

diff --git 
a/core/camel-main/src/generated/java/org/apache/camel/main/MetricsConfigurationPropertiesConfigurer.java
 
b/core/camel-main/src/generated/java/org/apache/camel/main/MetricsConfigurationPropertiesConfigurer.java
index dafd87e4da31..fb7d451b591a 100644
--- 
a/core/camel-main/src/generated/java/org/apache/camel/main/MetricsConfigurationPropertiesConfigurer.java
+++ 
b/core/camel-main/src/generated/java/org/apache/camel/main/MetricsConfigurationPropertiesConfigurer.java
@@ -33,6 +33,7 @@ public class MetricsConfigurationPropertiesConfigurer extends 
org.apache.camel.s
         map.put("Enabled", boolean.class);
         map.put("LogMetricsOnShutdown", boolean.class);
         map.put("LogMetricsOnShutdownFilters", java.lang.String.class);
+        map.put("LogMetricsOnShutdownFormat", java.lang.String.class);
         map.put("NamingStrategy", java.lang.String.class);
         map.put("Path", java.lang.String.class);
         map.put("RoutePolicyLevel", java.lang.String.class);
@@ -65,6 +66,8 @@ public class MetricsConfigurationPropertiesConfigurer extends 
org.apache.camel.s
         case "logMetricsOnShutdown": 
target.setLogMetricsOnShutdown(property(camelContext, boolean.class, value)); 
return true;
         case "logmetricsonshutdownfilters":
         case "logMetricsOnShutdownFilters": 
target.setLogMetricsOnShutdownFilters(property(camelContext, 
java.lang.String.class, value)); return true;
+        case "logmetricsonshutdownformat":
+        case "logMetricsOnShutdownFormat": 
target.setLogMetricsOnShutdownFormat(property(camelContext, 
java.lang.String.class, value)); return true;
         case "namingstrategy":
         case "namingStrategy": target.setNamingStrategy(property(camelContext, 
java.lang.String.class, value)); return true;
         case "path": target.setPath(property(camelContext, 
java.lang.String.class, value)); return true;
@@ -106,6 +109,8 @@ public class MetricsConfigurationPropertiesConfigurer 
extends org.apache.camel.s
         case "logMetricsOnShutdown": return boolean.class;
         case "logmetricsonshutdownfilters":
         case "logMetricsOnShutdownFilters": return java.lang.String.class;
+        case "logmetricsonshutdownformat":
+        case "logMetricsOnShutdownFormat": return java.lang.String.class;
         case "namingstrategy":
         case "namingStrategy": return java.lang.String.class;
         case "path": return java.lang.String.class;
@@ -143,6 +148,8 @@ public class MetricsConfigurationPropertiesConfigurer 
extends org.apache.camel.s
         case "logMetricsOnShutdown": return target.isLogMetricsOnShutdown();
         case "logmetricsonshutdownfilters":
         case "logMetricsOnShutdownFilters": return 
target.getLogMetricsOnShutdownFilters();
+        case "logmetricsonshutdownformat":
+        case "logMetricsOnShutdownFormat": return 
target.getLogMetricsOnShutdownFormat();
         case "namingstrategy":
         case "namingStrategy": return target.getNamingStrategy();
         case "path": return target.getPath();
diff --git 
a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
 
b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
index c03dd1557f00..1146c05cd1cc 100644
--- 
a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
+++ 
b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
@@ -334,6 +334,7 @@
     { "name": "camel.metrics.enableRoutePolicy", "required": false, 
"description": "Set whether to enable the MicrometerRoutePolicyFactory for 
capturing metrics on route processing times.", "sourceType": 
"org.apache.camel.main.MetricsConfigurationProperties", "type": "boolean", 
"javaType": "boolean", "defaultValue": true, "secret": false },
     { "name": "camel.metrics.logMetricsOnShutdown", "required": false, 
"description": "Log metrics when application is shutting down. (default, 
false).", "sourceType": "org.apache.camel.main.MetricsConfigurationProperties", 
"type": "boolean", "javaType": "boolean", "defaultValue": false, "secret": 
false },
     { "name": "camel.metrics.logMetricsOnShutdownFilters", "required": false, 
"description": "List of metrics (comma separated) to log when application is 
shutting down. You can use character to log any metrics containing the 
wildcard, for example camel.exchanges. (default to all metrics available).", 
"sourceType": "org.apache.camel.main.MetricsConfigurationProperties", "type": 
"string", "javaType": "java.lang.String", "secret": false },
+    { "name": "camel.metrics.logMetricsOnShutdownFormat", "required": false, 
"description": "Format used to log metrics when application is shutting down. 
Either json (default) or prometheus format.", "sourceType": 
"org.apache.camel.main.MetricsConfigurationProperties", "type": "enum", 
"javaType": "java.lang.String", "defaultValue": "json", "secret": false, 
"enum": [ "json", "prometheus" ] },
     { "name": "camel.metrics.namingStrategy", "required": false, 
"description": "Controls the name style to use for metrics. Default = uses 
micrometer naming convention. Legacy = uses the classic naming style 
(camelCase)", "sourceType": 
"org.apache.camel.main.MetricsConfigurationProperties", "type": "enum", 
"javaType": "java.lang.String", "defaultValue": "default", "secret": false, 
"enum": [ "default", "legacy" ] },
     { "name": "camel.metrics.path", "required": false, "description": "The 
path endpoint used to expose the metrics.", "sourceType": 
"org.apache.camel.main.MetricsConfigurationProperties", "type": "string", 
"javaType": "java.lang.String", "defaultValue": "\/observe\/metrics", "secret": 
false },
     { "name": "camel.metrics.routePolicyLevel", "required": false, 
"description": "Sets the level of information to capture. all = both context 
and routes.", "sourceType": 
"org.apache.camel.main.MetricsConfigurationProperties", "type": "enum", 
"javaType": "java.lang.String", "defaultValue": "all", "secret": false, "enum": 
[ "all", "route", "context" ] },
diff --git a/core/camel-main/src/main/docs/main.adoc 
b/core/camel-main/src/main/docs/main.adoc
index db7bd0eb0a19..3fe96305eab4 100644
--- a/core/camel-main/src/main/docs/main.adoc
+++ b/core/camel-main/src/main/docs/main.adoc
@@ -646,7 +646,7 @@ The camel.mdc supports 3 options, which are listed below.
 
 
 === Camel Micrometer Metrics configurations
-The camel.metrics supports 16 options, which are listed below.
+The camel.metrics supports 17 options, which are listed below.
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
@@ -662,6 +662,7 @@ The camel.metrics supports 16 options, which are listed 
below.
 | *camel.metrics.enableRoutePolicy* | Set whether to enable the 
MicrometerRoutePolicyFactory for capturing metrics on route processing times. | 
true | boolean
 | *camel.metrics.logMetricsOnShutdown* | Log metrics when application is 
shutting down. (default, false). | false | boolean
 | *camel.metrics.logMetricsOnShutdownFilters* | List of metrics (comma 
separated) to log when application is shutting down. You can use character to 
log any metrics containing the wildcard, for example camel.exchanges. (default 
to all metrics available). |  | String
+| *camel.metrics.logMetricsOnShutdownFormat* | Format used to log metrics when 
application is shutting down. Either json (default) or prometheus format. | 
json | String
 | *camel.metrics.namingStrategy* | Controls the name style to use for metrics. 
Default = uses micrometer naming convention. Legacy = uses the classic naming 
style (camelCase) | default | String
 | *camel.metrics.path* | The path endpoint used to expose the metrics. | 
/observe/metrics | String
 | *camel.metrics.routePolicyLevel* | Sets the level of information to capture. 
all = both context and routes. | all | String
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/MetricsConfigurationProperties.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/MetricsConfigurationProperties.java
index 79cb48c8cf83..a58bd6ee3f78 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/MetricsConfigurationProperties.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/MetricsConfigurationProperties.java
@@ -50,6 +50,8 @@ public class MetricsConfigurationProperties implements 
BootstrapCloseable {
     private boolean skipCamelInfo = false;
     @Metadata(defaultValue = "false")
     private boolean logMetricsOnShutdown = false;
+    @Metadata(defaultValue = "json", enums = "json,prometheus")
+    private String logMetricsOnShutdownFormat = "json";
     @Metadata(defaultValue = "0.0.4", enums = "0.0.4,1.0.0")
     private String textFormatVersion = "0.0.4";
     @Metadata
@@ -212,6 +214,17 @@ public class MetricsConfigurationProperties implements 
BootstrapCloseable {
         this.logMetricsOnShutdown = logMetricsOnShutdown;
     }
 
+    public String getLogMetricsOnShutdownFormat() {
+        return logMetricsOnShutdownFormat;
+    }
+
+    /**
+     * Format used to log metrics when application is shutting down. Either 
`json` (default) or `prometheus` format.
+     */
+    public void setLogMetricsOnShutdownFormat(String 
logMetricsOnShutdownFormat) {
+        this.logMetricsOnShutdownFormat = logMetricsOnShutdownFormat;
+    }
+
     public String getTextFormatVersion() {
         return textFormatVersion;
     }
@@ -366,6 +379,14 @@ public class MetricsConfigurationProperties implements 
BootstrapCloseable {
         return this;
     }
 
+    /**
+     * Format used to log metrics when application is shutting down. Either 
`json` (default) or `prometheus` format.
+     */
+    public MetricsConfigurationProperties 
withLogMetricsOnShutdownFormat(String logMetricsOnShutdownFormat) {
+        this.logMetricsOnShutdownFormat = logMetricsOnShutdownFormat;
+        return this;
+    }
+
     /**
      * The text-format version to use with Prometheus scraping.
      *

Reply via email to