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

gnodet pushed a commit to branch CAMEL-27955/fix-counter-decrement
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 19029285200edd8287465976a1edeb27f70635ad
Author: Guillaume Nodet <[email protected]>
AuthorDate: Sat Dec 5 00:10:27 2026 +0100

    CAMEL-27955: Deprecate counter decrement and warn about Prometheus 
limitation
    
    The decrement option on micrometer counters is deprecated because
    Micrometer counters are monotonic (they can only increase). Many
    registries, most notably Prometheus, silently ignore negative increments,
    making the decrement feature ineffective on production systems.
    
    Changes:
    - Added deprecation warning in CounterProducer when decrement is used
    - Deprecated the decrement field and its getter/setter in MicrometerEndpoint
    - Added upgrade guide entry recommending gauges for decreasing values
    - Regenerated catalog and endpoint DSL files
    
    Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
---
 .../camel/catalog/components/micrometer.json       |  2 +-
 .../jbang/camel-jbang-configuration-metadata.json  | 87 +++++++++++-----------
 .../camel/component/micrometer/micrometer.json     |  2 +-
 .../component/micrometer/CounterProducer.java      | 13 ++++
 .../component/micrometer/MicrometerEndpoint.java   |  5 +-
 .../ROOT/pages/camel-4x-upgrade-guide-4_25.adoc    |  9 +++
 .../dsl/MicrometerEndpointBuilderFactory.java      |  4 +-
 7 files changed, 74 insertions(+), 48 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/micrometer.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/micrometer.json
index 754d214b55e8..e53c18d9c86c 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/micrometer.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/micrometer.json
@@ -45,7 +45,7 @@
     "metricsType": { "index": 0, "kind": "path", "displayName": "Metrics 
Type", "group": "producer", "label": "", "required": false, "type": "enum", 
"javaType": "io.micrometer.core.instrument.Meter.Type", "enum": [ "counter", 
"summary", "timer" ], "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": "counter", "description": "The type of meter to update: 
counter, summary (a distribution summary) or timer." },
     "metricsName": { "index": 1, "kind": "path", "displayName": "Metrics 
Name", "group": "producer", "label": "", "required": true, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "supportSimpleExpression": true, "description": "The name of 
the meter." },
     "action": { "index": 2, "kind": "parameter", "displayName": "Action", 
"group": "producer", "label": "", "required": false, "type": "enum", 
"javaType": "java.lang.String", "enum": [ "start", "stop" ], "deprecated": 
false, "autowired": false, "secret": false, "supportSimpleExpression": true, 
"description": "The action for the timer type: start begins a timer sample on 
the exchange, and stop records the time since the start in the timer. If not 
set, the timer is not updated." },
-    "decrement": { "index": 3, "kind": "parameter", "displayName": 
"Decrement", "group": "producer", "label": "", "required": false, "type": 
"string", "javaType": "java.lang.String", "deprecated": false, "autowired": 
false, "secret": false, "supportSimpleExpression": true, "description": "The 
amount to subtract from the counter for the counter type, as a number or a 
Simple expression that gives one. Micrometer counters are meant to only 
increase, and some registries, such as Prometheus,  [...]
+    "decrement": { "index": 3, "kind": "parameter", "displayName": 
"Decrement", "group": "producer", "label": "", "required": false, "type": 
"string", "javaType": "java.lang.String", "deprecated": true, "autowired": 
false, "secret": false, "supportSimpleExpression": true, "description": "The 
amount to subtract from the counter for the counter type, as a number or a 
Simple expression that gives one. Micrometer counters are meant to only 
increase, and some registries, such as Prometheus, i [...]
     "increment": { "index": 4, "kind": "parameter", "displayName": 
"Increment", "group": "producer", "label": "", "required": false, "type": 
"string", "javaType": "java.lang.String", "deprecated": false, "autowired": 
false, "secret": false, "supportSimpleExpression": true, "description": "The 
amount to add to the counter for the counter type, as a number or a Simple 
expression that gives one. If neither increment nor decrement is set, the 
counter is incremented by 1. If both are set, inc [...]
     "metricsDescription": { "index": 5, "kind": "parameter", "displayName": 
"Metrics Description", "group": "producer", "label": "", "required": false, 
"type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "supportSimpleExpression": true, 
"description": "The description of the meter. Micrometer uses it only when the 
meter is first registered." },
     "tags": { "index": 6, "kind": "parameter", "displayName": "Tags", "group": 
"producer", "label": "", "required": false, "type": "object", "javaType": 
"java.util.Map<java.lang.String, java.lang.String>", "prefix": "tags.", 
"multiValue": true, "deprecated": false, "autowired": false, "secret": false, 
"supportSimpleExpression": true, "description": "The tags of the meter, one 
tags.key=value parameter per tag. The keys and values support Simple 
expressions. Camel also adds the camelContex [...]
diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/jbang/camel-jbang-configuration-metadata.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/jbang/camel-jbang-configuration-metadata.json
index ce3f1964b331..bd1bdf642d53 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/jbang/camel-jbang-configuration-metadata.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/jbang/camel-jbang-configuration-metadata.json
@@ -3,59 +3,58 @@
     { "name": "camel.jbang", "description": "Camel CLI configurations" }
   ],
   "properties": [
-    { "name": "camel.jbang.camel-version", "required": false, "description": 
"Camel version to run or export with, when it is not the version of the Camel 
CLI. camel run then runs the integration in a new JVM with JBang (Camel 4.0 or 
newer, not from the Camel launcher), and camel export uses it for the Camel 
dependencies of the project.", "type": "string", "javaType": "String", 
"secret": false },
-    { "name": "camel.jbang.camelSpringBootVersion", "required": false, 
"description": "Camel Spring Boot version (of camel-spring-boot-bom) in the 
project that camel export creates with the spring-boot runtime. By default the 
Camel version: camel.jbang.camel-version, else the version of the Camel CLI.", 
"label": "spring-boot", "type": "string", "javaType": "String", "secret": false 
},
-    { "name": "camel.jbang.camelWrapper", "required": false, "description": 
"Whether camel export adds the Camel Wrapper scripts (camel and camel.cmd) to 
the project, which run the Camel CLI of the Camel version of the export. Only 
with the camel-main runtime.", "type": "boolean", "javaType": "boolean", 
"defaultValue": false, "secret": false },
-    { "name": "camel.jbang.classpathFiles", "required": false, "description": 
"Files to add to the classpath, comma separated: JAR files, .class files and 
resource files. camel run fills it with the given files that are not Camel 
sources or properties files, and camel export copies the JAR files to the lib 
directory of the project and the other files to src\/main\/resources.", "type": 
"string", "javaType": "String", "secret": false },
-    { "name": "camel.jbang.compileWorkDir", "required": false, "description": 
"Directory where Camel writes the classes that it compiles at runtime from Java 
and Groovy sources.", "label": "advanced", "type": "string", "javaType": 
"String", "defaultValue": ".camel-jbang\/compile", "secret": false },
-    { "name": "camel.jbang.console", "required": false, "description": 
"Whether to turn on the developer console on the local HTTP server (port 8080 
by default): at \/q\/dev with camel run and the camel-main runtime, at 
\/actuator\/camel with Spring Boot, and at \/q\/camel\/dev-console with 
Quarkus. An exported project has it with the dev profile only.", "type": 
"boolean", "javaType": "boolean", "defaultValue": false, "secret": false, 
"security": "insecure:dev" },
-    { "name": "camel.jbang.dataDir", "required": false, "description": 
"Folders under the source directory (comma separated) that hold data the routes 
read or write, not sources: in dev mode a change in them does not reload the 
routes. Use this for an inbox, outbox or archive folder under the source 
directory.", "label": "advanced", "type": "string", "javaType": "String", 
"secret": false },
-    { "name": "camel.jbang.dependencies", "required": false, "description": 
"Additional dependencies, comma separated, such as camel:kafka or 
mvn:com.example:mylib:1.0 (groupId:artifactId:version). camel run downloads 
them, and camel export adds them to the project.", "type": "string", 
"javaType": "String", "secret": false },
-    { "name": "camel.jbang.dependencies.main", "required": false, 
"description": "Additional dependencies (comma separated, as in 
camel.jbang.dependencies) only for the camel-main runtime, which includes the 
jbang runtime of camel run.", "type": "string", "javaType": "String", "secret": 
false },
-    { "name": "camel.jbang.dependencies.quarkus", "required": false, 
"description": "Additional dependencies (comma separated, as in 
camel.jbang.dependencies) only for the quarkus runtime.", "type": "string", 
"javaType": "String", "secret": false },
-    { "name": "camel.jbang.dependencies.spring-boot", "required": false, 
"description": "Additional dependencies (comma separated, as in 
camel.jbang.dependencies) only for the spring-boot runtime.", "type": "string", 
"javaType": "String", "secret": false },
-    { "name": "camel.jbang.download", "required": false, "description": 
"Whether the Camel CLI may download dependencies from remote Maven 
repositories. When false it works offline, with the local Maven repository 
only.", "type": "boolean", "javaType": "boolean", "defaultValue": true, 
"secret": false },
-    { "name": "camel.jbang.excludes", "required": false, "description": "Files 
to leave out of camel run and camel export, comma separated: a file name or an 
Ant-style path pattern, matched against the name and against the given path of 
each file.", "type": "string", "javaType": "String", "secret": false },
+    { "name": "camel.jbang.camel-version", "required": false, "description": 
"The version of Apache Camel to use", "type": "string", "javaType": "String", 
"secret": false },
+    { "name": "camel.jbang.camelSpringBootVersion", "required": false, 
"description": "To use a custom Camel version when running or export to Spring 
Boot", "label": "spring-boot", "type": "string", "javaType": "String", 
"secret": false },
+    { "name": "camel.jbang.camelWrapper", "required": false, "description": 
"Include Camel Wrapper scripts in the exported project for version pinning", 
"type": "boolean", "javaType": "boolean", "defaultValue": false, "secret": 
false },
+    { "name": "camel.jbang.classpathFiles", "required": false, "description": 
"Additional files to add to classpath (Use commas to separate multiple 
files).", "type": "string", "javaType": "String", "secret": false },
+    { "name": "camel.jbang.compileWorkDir", "required": false, "description": 
"Work directory for compiler. Can be used to write compiled classes or other 
resources.", "label": "advanced", "type": "string", "javaType": "String", 
"defaultValue": ".camel-jbang\/compile", "secret": false },
+    { "name": "camel.jbang.console", "required": false, "description": 
"Developer console at \/q\/dev on local HTTP server (port 8080 by default)", 
"type": "boolean", "javaType": "boolean", "defaultValue": false, "secret": 
false },
+    { "name": "camel.jbang.dependencies", "required": false, "description": 
"Additional dependencies (Use commas to separate multiple dependencies).", 
"type": "string", "javaType": "String", "secret": false },
+    { "name": "camel.jbang.dependencies.main", "required": false, 
"description": "Additional dependencies for Camel Main runtime only", "type": 
"string", "javaType": "String", "secret": false },
+    { "name": "camel.jbang.dependencies.quarkus", "required": false, 
"description": "Additional dependencies for Quarkus runtime only", "type": 
"string", "javaType": "String", "secret": false },
+    { "name": "camel.jbang.dependencies.spring-boot", "required": false, 
"description": "Additional dependencies for Spring Boot runtime only", "type": 
"string", "javaType": "String", "secret": false },
+    { "name": "camel.jbang.download", "required": false, "description": 
"Whether to allow automatic downloading JAR dependencies (over the internet)", 
"type": "boolean", "javaType": "boolean", "defaultValue": true, "secret": false 
},
+    { "name": "camel.jbang.excludes", "required": false, "description": 
"Exclude files by name or pattern (Use commas to separate multiple files)", 
"type": "string", "javaType": "String", "secret": false },
     { "name": "camel.jbang.exportDir", "required": false, "description": 
"Directory where the project will be exported", "type": "string", "javaType": 
"String", "defaultValue": ".", "secret": false },
-    { "name": "camel.jbang.fresh", "required": false, "description": "Whether 
to check the remote Maven repositories on every download for newer SNAPSHOT 
versions and metadata, instead of using what is already in the local Maven 
repository.", "type": "boolean", "javaType": "boolean", "defaultValue": false, 
"secret": false },
-    { "name": "camel.jbang.gav", "required": false, "description": "Maven 
coordinates (groupId:artifactId:version) of the project that camel export 
creates. By default org.example.project:name:1.0-SNAPSHOT, with the name of the 
integration or of its first file. A Java source without a package gets one made 
from the groupId and artifactId.", "type": "string", "javaType": "String", 
"secret": false },
-    { "name": "camel.jbang.groovyFiles", "required": false, "description": 
"Groovy source files, comma separated, that camel-groovy pre-compiles at 
startup so the routes can use their classes. camel run fills it with the given 
.groovy files, and camel export copies them to 
src\/main\/resources\/camel-groovy.", "type": "string", "javaType": "String", 
"secret": false },
+    { "name": "camel.jbang.fresh", "required": false, "description": "Whether 
to force using fresh (i.e. non-cached) resources", "type": "boolean", 
"javaType": "boolean", "defaultValue": false, "secret": false },
+    { "name": "camel.jbang.gav", "required": false, "description": "Maven 
coordinate (groupId:artifactId:version)", "type": "string", "javaType": 
"String", "secret": false },
+    { "name": "camel.jbang.groovyFiles", "required": false, "description": 
"Additional groovy source files to export to src\/main\/resources\/camel-groovy 
directory (Use commas to separate multiple files)", "type": "string", 
"javaType": "String", "secret": false },
     { "name": "camel.jbang.health", "required": false, "description": "Health 
check at \/observe\/health on local HTTP server (port 8080 by default)", 
"type": "boolean", "javaType": "boolean", "defaultValue": false, "secret": 
false, "deprecated": true },
-    { "name": "camel.jbang.ignoreLoadingError", "required": false, 
"description": "Whether to keep going when routes fail to load or compile, 
leaving those routes out, and to keep unresolved property placeholders as they 
are and ignore missing properties files. For development and tooling only.", 
"label": "advanced", "type": "boolean", "javaType": "boolean", "defaultValue": 
false, "secret": false },
-    { "name": "camel.jbang.javaVersion", "required": false, "description": 
"Java version of the project that camel export creates: the Java release in the 
pom.xml, and the Java version of the Dockerfile and of the container base 
image. camel run also passes it to JBang when it runs the integration in a new 
JVM, such as with another Camel version.", "type": "enum", "javaType": 
"String", "defaultValue": "21", "secret": false, "enum": [ "21", "25" ] },
-    { "name": "camel.jbang.jfr", "required": false, "description": "Whether to 
record with Java Flight Recorder, saving the recording on exit to a .jfr file 
named after the integration.", "type": "boolean", "javaType": "boolean", 
"defaultValue": false, "secret": false },
-    { "name": "camel.jbang.jfr-profile", "required": false, "description": 
"Java Flight Recorder settings to record with: default (low overhead) or 
profile (more detail), as the JDK provides them. Setting it turns on the 
recording too.", "type": "string", "javaType": "String", "defaultValue": 
"default", "secret": false },
+    { "name": "camel.jbang.ignoreLoadingError", "required": false, 
"description": "Whether to ignore route loading and compilation errors (use 
this with care!)", "label": "advanced", "type": "boolean", "javaType": 
"boolean", "defaultValue": false, "secret": false },
+    { "name": "camel.jbang.javaVersion", "required": false, "description": 
"Java version", "type": "enum", "javaType": "String", "defaultValue": "21", 
"secret": false, "enum": [ "21" ] },
+    { "name": "camel.jbang.jfr", "required": false, "description": "Enables 
Java Flight Recorder saving recording to disk on exit", "type": "boolean", 
"javaType": "boolean", "defaultValue": false, "secret": false },
+    { "name": "camel.jbang.jfr-profile", "required": false, "description": 
"Java Flight Recorder profile to use (such as default or profile)", "type": 
"string", "javaType": "String", "defaultValue": "default", "secret": false },
     { "name": "camel.jbang.jib-maven-plugin-version", "required": false, 
"description": "Version to use for jib-maven-plugin when exporting the 
application", "label": "maven", "type": "string", "javaType": "String", 
"defaultValue": "3.5.2", "secret": false },
-    { "name": "camel.jbang.jkube-maven-plugin-version", "required": false, 
"description": "Version of the Eclipse JKube kubernetes-maven-plugin in the 
project that camel export creates with the camel-main runtime, when the 
application properties have options that start with jkube.", "label": 
"kubernetes", "type": "string", "javaType": "String", "defaultValue": "1.20.0", 
"secret": false },
-    { "name": "camel.jbang.jkubeFiles", "required": false, "description": 
"Eclipse JKube resource fragments, comma separated, that camel export copies to 
src\/main\/jkube of the project without .jkube in their name 
(deployment.jkube.yaml becomes deployment.yaml). camel run fills it with the 
given .jkube.yaml and .jkube.yml files.", "label": "kubernetes", "type": 
"string", "javaType": "String", "secret": false },
-    { "name": "camel.jbang.kameletsVersion", "required": false, "description": 
"Version of the Apache Camel Kamelets 
(org.apache.camel.kamelets:camel-kamelets) that camel run loads the Kamelets 
from and camel export adds to the project. By default the version of the 
Kamelets that come with the Camel CLI.", "type": "string", "javaType": 
"String", "secret": false },
-    { "name": "camel.jbang.lazyBean", "required": false, "description": 
"Whether the beans of bean annotations (Camel BindToRegistry, Spring Bean and 
Quarkus Produces methods) are created when first looked up, instead of at 
startup. This can help with class loading issues.", "label": "advanced", 
"type": "boolean", "javaType": "boolean", "defaultValue": false, "secret": 
false },
-    { "name": "camel.jbang.localKameletDir", "required": false, "description": 
"Directories (or GitHub links) to load Kamelets from, comma separated. Their 
Kamelets take precedence over the ones of the Kamelet catalog, and camel export 
copies the Kamelets that the routes use from them into the project.", "type": 
"string", "javaType": "String", "secret": false },
+    { "name": "camel.jbang.jkube-maven-plugin-version", "required": false, 
"description": "Version to use for jkube-maven-plugin if exporting to 
camel-main and have Kubernetes enabled (jkube.xxx options)", "label": 
"kubernetes", "type": "string", "javaType": "String", "defaultValue": "1.20.0", 
"secret": false },
+    { "name": "camel.jbang.jkubeFiles", "required": false, "description": 
"Resource YAML fragments for Kubernetes using Eclipse JKube tool (Use commas to 
separate multiple files).", "label": "kubernetes", "type": "string", 
"javaType": "String", "secret": false },
+    { "name": "camel.jbang.kameletsVersion", "required": false, "description": 
"Apache Camel Kamelets version. By default the Kamelets are the same version as 
Camel.", "type": "string", "javaType": "String", "secret": false },
+    { "name": "camel.jbang.lazyBean", "required": false, "description": 
"Whether to use lazy bean initialization (can help with complex classloading 
issues)", "label": "advanced", "type": "boolean", "javaType": "boolean", 
"defaultValue": false, "secret": false },
+    { "name": "camel.jbang.localKameletDir", "required": false, "description": 
"Local file directory for loading custom Kamelets", "type": "string", 
"javaType": "String", "secret": false },
     { "name": "camel.jbang.maven-apache-snapshot-enabled", "required": false, 
"description": "Whether downloading JARs from ASF Maven Snapshot repository is 
enabled", "label": "maven", "type": "boolean", "javaType": "boolean", 
"defaultValue": true, "secret": false },
     { "name": "camel.jbang.maven-central-enabled", "required": false, 
"description": "Whether downloading JARs from Maven Central repository is 
enabled", "label": "maven", "type": "boolean", "javaType": "boolean", 
"defaultValue": true, "secret": false },
-    { "name": "camel.jbang.maven-settings", "required": false, "description": 
"Location of the Maven settings.xml file with the servers, repositories, 
mirrors and proxies to use for downloads. By default the settings.xml in the 
.m2 directory of the user home; set to false to use no settings file at all.", 
"label": "maven", "type": "string", "javaType": "String", "secret": false },
-    { "name": "camel.jbang.maven-settings-security", "required": false, 
"description": "Location of the Maven settings-security.xml file that decrypts 
the encrypted passwords of settings.xml. By default the settings-security.xml 
in the .m2 directory of the user home.", "label": "maven", "type": "string", 
"javaType": "String", "secret": false },
+    { "name": "camel.jbang.maven-settings", "required": false, "description": 
"Optional location of Maven settings.xml file to configure servers, 
repositories, mirrors, and proxies. If set to false, not even the default 
\/.m2\/settings.xml will be used.", "label": "maven", "type": "string", 
"javaType": "String", "secret": false },
+    { "name": "camel.jbang.maven-settings-security", "required": false, 
"description": "Optional location of Maven settings-security.xml file to 
decrypt Maven Settings (settings.xml) file", "label": "maven", "type": 
"string", "javaType": "String", "secret": false },
     { "name": "camel.jbang.mavenWrapper", "required": false, "description": 
"Include Maven Wrapper files in the exported project", "type": "boolean", 
"javaType": "boolean", "defaultValue": true, "secret": false },
     { "name": "camel.jbang.mcp", "required": false, "description": "Embed 
dev\/diagnostics MCP tools on the local HTTP management server (\/mcp by 
default)", "type": "boolean", "javaType": "boolean", "defaultValue": false, 
"secret": false, "security": "insecure:dev" },
     { "name": "camel.jbang.metrics", "required": false, "description": 
"Metrics (Micrometer and Prometheus) at \/observe\/metrics on local HTTP server 
(port 8080 by default) when running standalone Camel", "type": "boolean", 
"javaType": "boolean", "defaultValue": false, "secret": false, "deprecated": 
true },
-    { "name": "camel.jbang.openApi", "required": false, "description": 
"OpenAPI specification file (JSON or YAML) for contract-first REST: camel run 
and camel export add a Rest DSL that serves the API of the file, with client 
request validation turned on, and put the file on the classpath.", "type": 
"string", "javaType": "String", "secret": false },
+    { "name": "camel.jbang.openApi", "required": false, "description": "File 
name of open-api spec file (JSON or YAML) to generate routes from the 
swagger\/openapi API spec file.", "type": "string", "javaType": "String", 
"secret": false },
     { "name": "camel.jbang.openapiUi", "required": false, "description": 
"Swagger UI for REST OpenAPI at \/q\/openapi on local HTTP server (port 8080 by 
default)", "type": "boolean", "javaType": "boolean", "defaultValue": false, 
"secret": false, "security": "insecure:dev" },
-    { "name": "camel.jbang.packageScanJars", "required": false, "description": 
"Whether to scan the JARs that camel run downloads for Camel configuration 
classes and Spring or Quarkus beans, so the routes can use them.", "label": 
"advanced", "type": "boolean", "javaType": "boolean", "defaultValue": false, 
"secret": false },
+    { "name": "camel.jbang.packageScanJars", "required": false, "description": 
"Whether to automatic package scan JARs for custom Spring or Quarkus beans 
making them available for Camel CLI", "label": "advanced", "type": "boolean", 
"javaType": "boolean", "defaultValue": false, "secret": false },
     { "name": "camel.jbang.parentPom", "required": false, "description": 
"Parent POM coordinate (groupId:artifactId:version) to use in the exported 
project", "type": "string", "javaType": "String", "secret": false },
-    { "name": "camel.jbang.prompt", "required": false, "description": "Whether 
camel run asks in the terminal for the value of a property placeholder that is 
not configured, instead of failing. Needs an interactive terminal.", "label": 
"advanced", "type": "boolean", "javaType": "boolean", "defaultValue": false, 
"secret": false },
-    { "name": "camel.jbang.quarkusArtifactId", "required": false, 
"description": "Not used: the Camel CLI uses the quarkus-bom or 
quarkus-camel-bom artifactId as needed. Kept for compatibility, and to be 
removed.", "label": "quarkus", "type": "string", "javaType": "String", 
"secret": false, "deprecated": true },
-    { "name": "camel.jbang.quarkusExtensionRegistryBaseUri", "required": 
false, "description": "Base URI of the Quarkus Extension Registry, where the 
Camel CLI looks up the Quarkus Platform version that matches the Camel version 
when camel.jbang.quarkusVersion is not set. By default 
https:\/\/registry.quarkus.io.", "label": "quarkus", "type": "string", 
"javaType": "String", "secret": false },
-    { "name": "camel.jbang.quarkusGroupId", "required": false, "description": 
"groupId of the Quarkus Platform BOM, io.quarkus.platform by default. Used only 
when camel.jbang.quarkusVersion is set.", "label": "quarkus", "type": "string", 
"javaType": "String", "secret": false },
-    { "name": "camel.jbang.quarkusVersion", "required": false, "description": 
"Version of the Quarkus Platform BOM for the quarkus runtime of camel run and 
camel export. When not set, the Camel CLI looks up the Quarkus Platform version 
that matches the Camel version in the Quarkus Extension Registry.", "label": 
"quarkus", "type": "string", "javaType": "String", "secret": false },
-    { "name": "camel.jbang.readmeFiles", "required": false, "description": 
"README files of the integration, comma separated, which the Camel CLI shows 
for the running integration. camel run fills it with the given files whose name 
starts with readme, and puts them on the classpath too.", "type": "string", 
"javaType": "String", "secret": false },
-    { "name": "camel.jbang.repos", "required": false, "description": 
"Additional Maven repositories (URLs, comma separated) to download dependencies 
from. camel export also adds them to the pom.xml of the project.", "label": 
"maven", "type": "string", "javaType": "String", "secret": false },
-    { "name": "camel.jbang.resourceDirs", "required": false, "description": 
"Resource directories, comma separated: camel run adds their files to the 
classpath with their directory structure, and camel export copies each 
directory with its structure into src\/main\/resources. Set by the 
--resource-dir option of camel run and camel export.", "type": "string", 
"javaType": "String", "secret": false },
-    { "name": "camel.jbang.runtime", "required": false, "description": 
"Runtime of the project that camel export creates: camel-main, spring-boot or 
quarkus. camel run does not read it, it runs with its --runtime option.", 
"type": "enum", "javaType": "String", "secret": false, "enum": [ "camel-main", 
"spring-boot", "quarkus" ] },
-    { "name": "camel.jbang.scriptFiles", "required": false, "description": 
"Shell script files, comma separated, that camel export copies to 
src\/main\/scripts of the project. camel run fills it with the given .sh 
files.", "type": "string", "javaType": "String", "secret": false },
-    { "name": "camel.jbang.sourceDir", "required": false, "description": 
"Directory that camel run loads and runs all the Camel files of, subdirectories 
included, instead of files given one by one (the two cannot be combined). Its 
application.properties is used, and files of other kinds in it are ignored. Set 
by the --source-dir option of camel run.", "label": "advanced", "type": 
"string", "javaType": "String", "secret": false },
-    { "name": "camel.jbang.springBootVersion", "required": false, 
"description": "Spring Boot version for the spring-boot runtime: the version of 
the Spring Boot parent POM and BOM in the project that camel export creates. By 
default the Spring Boot version that this Camel release is built with.", 
"label": "spring-boot", "type": "string", "javaType": "String", "secret": false 
},
-    { "name": "camel.jbang.stub", "required": false, "description": 
"Components or endpoints to replace with stubs that do not connect to the real 
systems, comma separated: a component name (such as kafka), an endpoint URI or 
pattern (such as kafka:orders), all for every component, or remote for the 
components that connect to remote systems.", "type": "string", "javaType": 
"String", "secret": false },
-    { "name": "camel.jbang.tlsFiles", "required": false, "description": "TLS 
certificate and key files, comma separated, that camel export copies to 
src\/main\/tls of the project. camel run fills it with the given .crt, .key and 
.pem files.", "type": "string", "javaType": "String", "secret": false },
-    { "name": "camel.jbang.verbose", "required": false, "description": 
"Whether to log more about startup, such as the dependencies that are resolved 
and downloaded.", "type": "boolean", "javaType": "boolean", "defaultValue": 
false, "secret": false }
+    { "name": "camel.jbang.prompt", "required": false, "description": "Allow 
user to type in required parameters in prompt if not present in application", 
"label": "advanced", "type": "boolean", "javaType": "boolean", "defaultValue": 
false, "secret": false },
+    { "name": "camel.jbang.quarkusArtifactId", "required": false, 
"description": "artifactId of Quarkus Platform BOM", "label": "quarkus", 
"type": "string", "javaType": "String", "secret": false, "deprecated": true },
+    { "name": "camel.jbang.quarkusExtensionRegistryBaseUri", "required": 
false, "description": "The base URI of Quarkus Extension Registry", "label": 
"quarkus", "type": "string", "javaType": "String", "secret": false },
+    { "name": "camel.jbang.quarkusGroupId", "required": false, "description": 
"groupId of Quarkus Platform BOM", "label": "quarkus", "type": "string", 
"javaType": "String", "secret": false },
+    { "name": "camel.jbang.quarkusVersion", "required": false, "description": 
"version of Quarkus Platform BOM", "label": "quarkus", "type": "string", 
"javaType": "String", "secret": false },
+    { "name": "camel.jbang.readmeFiles", "required": false, "description": 
"README files included with the integration (Use commas to separate multiple 
files)", "type": "string", "javaType": "String", "secret": false },
+    { "name": "camel.jbang.repos", "required": false, "description": 
"Additional Maven repositories for download on-demand (Use commas to separate 
multiple repositories)", "label": "maven", "type": "string", "javaType": 
"String", "secret": false },
+    { "name": "camel.jbang.resourceDirs", "required": false, "description": 
"Additional resource directories to include recursively, preserving directory 
structure (Use commas to separate multiple directories)", "type": "string", 
"javaType": "String", "secret": false },
+    { "name": "camel.jbang.runtime", "required": false, "description": "Which 
runtime to use (camel-main, spring-boot, quarkus)", "type": "enum", "javaType": 
"String", "secret": false, "enum": [ "camel-main", "spring-boot", "quarkus" ] },
+    { "name": "camel.jbang.scriptFiles", "required": false, "description": 
"Additional shell script files to export to src\/main\/scripts directory", 
"type": "string", "javaType": "String", "secret": false },
+    { "name": "camel.jbang.sourceDir", "required": false, "description": 
"Source directory for dynamically loading Camel file(s) to run. When using 
this, then files cannot be specified at the same time.", "label": "advanced", 
"type": "string", "javaType": "String", "secret": false },
+    { "name": "camel.jbang.springBootVersion", "required": false, 
"description": "Spring Boot version", "label": "spring-boot", "type": "string", 
"javaType": "String", "secret": false },
+    { "name": "camel.jbang.stub", "required": false, "description": "Stubs all 
the matching endpoint with the given component name or pattern. Multiple names 
can be separated by comma. (all = stub all endpoints, remote = stub only remote 
components).", "type": "string", "javaType": "String", "secret": false },
+    { "name": "camel.jbang.tlsFiles", "required": false, "description": 
"Additional SSL\/TLS files to export to src\/main\/tls directory", "type": 
"string", "javaType": "String", "secret": false },
+    { "name": "camel.jbang.verbose", "required": false, "description": 
"Verbose output of startup activity (dependency resolution and downloading", 
"type": "boolean", "javaType": "boolean", "defaultValue": false, "secret": 
false }
   ]
 }
diff --git 
a/components/camel-micrometer/src/generated/resources/META-INF/org/apache/camel/component/micrometer/micrometer.json
 
b/components/camel-micrometer/src/generated/resources/META-INF/org/apache/camel/component/micrometer/micrometer.json
index 754d214b55e8..e53c18d9c86c 100644
--- 
a/components/camel-micrometer/src/generated/resources/META-INF/org/apache/camel/component/micrometer/micrometer.json
+++ 
b/components/camel-micrometer/src/generated/resources/META-INF/org/apache/camel/component/micrometer/micrometer.json
@@ -45,7 +45,7 @@
     "metricsType": { "index": 0, "kind": "path", "displayName": "Metrics 
Type", "group": "producer", "label": "", "required": false, "type": "enum", 
"javaType": "io.micrometer.core.instrument.Meter.Type", "enum": [ "counter", 
"summary", "timer" ], "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": "counter", "description": "The type of meter to update: 
counter, summary (a distribution summary) or timer." },
     "metricsName": { "index": 1, "kind": "path", "displayName": "Metrics 
Name", "group": "producer", "label": "", "required": true, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "supportSimpleExpression": true, "description": "The name of 
the meter." },
     "action": { "index": 2, "kind": "parameter", "displayName": "Action", 
"group": "producer", "label": "", "required": false, "type": "enum", 
"javaType": "java.lang.String", "enum": [ "start", "stop" ], "deprecated": 
false, "autowired": false, "secret": false, "supportSimpleExpression": true, 
"description": "The action for the timer type: start begins a timer sample on 
the exchange, and stop records the time since the start in the timer. If not 
set, the timer is not updated." },
-    "decrement": { "index": 3, "kind": "parameter", "displayName": 
"Decrement", "group": "producer", "label": "", "required": false, "type": 
"string", "javaType": "java.lang.String", "deprecated": false, "autowired": 
false, "secret": false, "supportSimpleExpression": true, "description": "The 
amount to subtract from the counter for the counter type, as a number or a 
Simple expression that gives one. Micrometer counters are meant to only 
increase, and some registries, such as Prometheus,  [...]
+    "decrement": { "index": 3, "kind": "parameter", "displayName": 
"Decrement", "group": "producer", "label": "", "required": false, "type": 
"string", "javaType": "java.lang.String", "deprecated": true, "autowired": 
false, "secret": false, "supportSimpleExpression": true, "description": "The 
amount to subtract from the counter for the counter type, as a number or a 
Simple expression that gives one. Micrometer counters are meant to only 
increase, and some registries, such as Prometheus, i [...]
     "increment": { "index": 4, "kind": "parameter", "displayName": 
"Increment", "group": "producer", "label": "", "required": false, "type": 
"string", "javaType": "java.lang.String", "deprecated": false, "autowired": 
false, "secret": false, "supportSimpleExpression": true, "description": "The 
amount to add to the counter for the counter type, as a number or a Simple 
expression that gives one. If neither increment nor decrement is set, the 
counter is incremented by 1. If both are set, inc [...]
     "metricsDescription": { "index": 5, "kind": "parameter", "displayName": 
"Metrics Description", "group": "producer", "label": "", "required": false, 
"type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "supportSimpleExpression": true, 
"description": "The description of the meter. Micrometer uses it only when the 
meter is first registered." },
     "tags": { "index": 6, "kind": "parameter", "displayName": "Tags", "group": 
"producer", "label": "", "required": false, "type": "object", "javaType": 
"java.util.Map<java.lang.String, java.lang.String>", "prefix": "tags.", 
"multiValue": true, "deprecated": false, "autowired": false, "secret": false, 
"supportSimpleExpression": true, "description": "The tags of the meter, one 
tags.key=value parameter per tag. The keys and values support Simple 
expressions. Camel also adds the camelContex [...]
diff --git 
a/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/CounterProducer.java
 
b/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/CounterProducer.java
index c14967af142f..616fe9048d38 100644
--- 
a/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/CounterProducer.java
+++ 
b/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/CounterProducer.java
@@ -23,12 +23,17 @@ import io.micrometer.core.instrument.MeterRegistry;
 import io.micrometer.core.instrument.Tag;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import static 
org.apache.camel.component.micrometer.MicrometerConstants.HEADER_COUNTER_DECREMENT;
 import static 
org.apache.camel.component.micrometer.MicrometerConstants.HEADER_COUNTER_INCREMENT;
 
 public class CounterProducer extends AbstractMicrometerProducer<Counter> {
 
+    private static final Logger LOG = 
LoggerFactory.getLogger(CounterProducer.class);
+    private volatile boolean decrementWarningLogged;
+
     public CounterProducer(MicrometerEndpoint endpoint) {
         super(endpoint);
     }
@@ -48,6 +53,14 @@ public class CounterProducer extends 
AbstractMicrometerProducer<Counter> {
         if (finalIncrement != null) {
             counter.increment(finalIncrement);
         } else if (finalDecrement != null) {
+            if (!decrementWarningLogged) {
+                LOG.warn(
+                        "Decrement on counter '{}' is deprecated and may not 
work with all registries. "
+                         + "Micrometer counters are monotonic and some 
registries (e.g., Prometheus) silently ignore negative increments. "
+                         + "Consider using a gauge instead for values that can 
decrease.",
+                        counter.getId().getName());
+                decrementWarningLogged = true;
+            }
             counter.increment(-finalDecrement);
         } else if (endpoint.getIncrement() != null || endpoint.getDecrement() 
!= null) {
             // an increment or decrement is configured, but it did not give a 
number (such as a Map or null body)
diff --git 
a/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/MicrometerEndpoint.java
 
b/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/MicrometerEndpoint.java
index 8fdae0cb1b89..96e139dbfbb5 100644
--- 
a/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/MicrometerEndpoint.java
+++ 
b/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/MicrometerEndpoint.java
@@ -83,8 +83,9 @@ public class MicrometerEndpoint extends DefaultEndpoint {
     private String increment;
     @UriParam(description = "The amount to subtract from the counter for the 
counter type, as a number or a Simple expression"
                             + " that gives one. Micrometer counters are meant 
to only increase, and some registries, such as Prometheus, ignore a"
-                            + " decrement.")
+                            + " decrement. Deprecated: use a gauge instead for 
values that can decrease.")
     @Metadata(supportSimpleExpression = true)
+    @Deprecated(since = "4.25.0")
     private String decrement;
 
     public MicrometerEndpoint(String uri, Component component, MeterRegistry 
registry, Meter.Type metricsType,
@@ -181,10 +182,12 @@ public class MicrometerEndpoint extends DefaultEndpoint {
         this.increment = increment;
     }
 
+    @Deprecated(since = "4.25.0")
     public String getDecrement() {
         return decrement;
     }
 
+    @Deprecated(since = "4.25.0")
     public void setDecrement(String decrement) {
         this.decrement = decrement;
     }
diff --git 
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_25.adoc 
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_25.adoc
index 989e8a48161f..7c87a4ee0b56 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_25.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_25.adoc
@@ -116,6 +116,15 @@ The `CamelLangChain4jAgentResponseModel` header is now 
deprecated because the La
 
 The `CamelLangChain4jAgentExcludeTags` and 
`CamelLangChain4jAgentExcludeMcpServers` headers now correctly handle 
whitespace around comma-separated names.
 
+=== camel-micrometer - counter decrement is deprecated
+
+The `decrement` option and the `CamelMetricsCounterDecrement` header of the 
counter type are deprecated. Micrometer
+counters are monotonic (they can only increase), and many registries, most 
notably Prometheus, silently ignore negative
+increments. When a decrement is used, the producer now logs a deprecation 
warning.
+
+For values that can both increase and decrease, use a gauge instead. The gauge 
type of the `camel-micrometer` component,
+or the `camel-opentelemetry-metrics` component, can track such values.
+
 === Modeline (//DEPS lines in route files) deprecated
 
 Modeline, the JBang style `//DEPS` lines in route files that `camel run` reads 
to download extra dependencies, is
diff --git 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MicrometerEndpointBuilderFactory.java
 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MicrometerEndpointBuilderFactory.java
index d74803708d2a..8ac385d7c846 100644
--- 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MicrometerEndpointBuilderFactory.java
+++ 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MicrometerEndpointBuilderFactory.java
@@ -65,7 +65,8 @@ public interface MicrometerEndpointBuilderFactory {
          * The amount to subtract from the counter for the counter type, as a
          * number or a Simple expression that gives one. Micrometer counters 
are
          * meant to only increase, and some registries, such as Prometheus,
-         * ignore a decrement.
+         * ignore a decrement. Deprecated: use a gauge instead for values that
+         * can decrease.
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -74,6 +75,7 @@ public interface MicrometerEndpointBuilderFactory {
          * @param decrement the value to set
          * @return the dsl builder
          */
+        @Deprecated
         default MicrometerEndpointBuilder decrement(String decrement) {
             doSetProperty("decrement", decrement);
             return this;

Reply via email to