Skip to content

Flag to register JCache cache.removals as FunctionCounter - #6471

Merged
jonatan-ivanov merged 1 commit into
micrometer-metrics:1.13.xfrom
shakuzen:jcache-fcounter
Jun 26, 2025
Merged

jonatan-ivanov merged 1 commit into
micrometer-metrics:1.13.xfrom
shakuzen:jcache-fcounter

Conversation

@shakuzen

Copy link
Copy Markdown
Member

Some other CacheMeterBinder implementations are known to register the cache.removals meter as a FunctionCounter, which is more semantically accurate. For backward compatibility, we do not want to unconditionally change the meter type for everyone, especially in a maintenance release. However, we want to make it possible to register the cache.removals as a FunctionCounter to align it. In the future, we can flip the default for this flag.

See gh-6434

Some other CacheMeterBinder implementations are known to register the `cache.removals` meter as a FunctionCounter, which is more semantically accurate. For backward compatibility, we do not want to unconditionally change the meter type for everyone, especially in a maintenance release. However, we want to make it possible to register the `cache.removals` as a `FunctionCounter` to align it. In the future, we can flip the default for this flag.

See micrometer-metricsgh-6434
@jonatan-ivanov jonatan-ivanov added this to the 1.14.9 milestone Jun 26, 2025
@jonatan-ivanov
jonatan-ivanov merged commit b367ff5 into micrometer-metrics:1.13.x Jun 26, 2025
@shakuzen
shakuzen deleted the jcache-fcounter branch June 27, 2025 07:16
shakuzen added a commit that referenced this pull request Jun 27, 2025
This switches the default of the `registerCacheRemovalsAsFunctionCounter` flag from `false` to `true`. This may be a breaking change depending on the backend used and the usage of this metric in queries. This change makes the behavior what we want by default while still allowing users to fall back to the previous behavior by setting the flag to `false` to maintain compatibility with the behavior in prior versions.

See gh-6471
Resolves gh-2754
@jonatan-ivanov jonatan-ivanov added instrumentation An issue that is related to instrumenting a component and removed module: micrometer-binders labels Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug A general bug instrumentation An issue that is related to instrumenting a component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants