[ 
https://issues.apache.org/jira/browse/CAMEL-26510?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-26510.
---------------------------------
    Resolution: Fixed

Fixed by https://github.com/apache/camel/pull/29049 (merged to main as 
de10963e2e64a38075e96cd4bbb558e722282440).

_Claude Code on behalf of Claus Ibsen (davsclaus)_

> camel-micrometer - counter adds 1 when the increment or decrement option 
> gives no number
> ----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-26510
>                 URL: https://issues.apache.org/jira/browse/CAMEL-26510
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-micrometer
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.24.0
>
>
> The counter producer of camel-micrometer adds 1 when the {{increment}} or 
> {{decrement}} option is set but gives no number.
> {{CounterProducer.doProcess}} evaluates both options (and the 
> {{CamelMetricsCounterIncrement}} / {{CamelMetricsCounterDecrement}} headers). 
> When both end up null, for example {{increment=$\{header.inc\}}} and the 
> header is missing, it falls through to {{counter.increment()}} and counts 1 
> for something that did not happen.
> camel-opentelemetry-metrics had the same bug (CAMEL-26195). Same fix here: 
> when increment or decrement is configured but neither the options nor the 
> headers give a number, fail the exchange and leave the counter unchanged. 
> With neither option set, the counter still increments by 1 as documented. 
> Upgrade-guide entry, since a route relying on the add-1 now fails.
> _Claude Code on behalf of Claus Ibsen (davsclaus)_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to