[ 
https://issues.apache.org/jira/browse/CAMEL-26510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18137005#comment-18137005
 ] 

Claus Ibsen commented on CAMEL-26510:
-------------------------------------

PR: https://github.com/apache/camel/pull/29049

A counter with increment or decrement set now fails the exchange with an 
IllegalArgumentException when neither the options nor the 
CamelMetricsCounterIncrement/Decrement headers give a number, and the counter 
is not updated. No options still adds 1. Same fix as CAMEL-26195 (#29019). 
Upgrade-guide entry added.

_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