Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The metric "cache.load.duration" in CaffeineCacheMetrics binder has the wrong Meter type. #5803

Open
wikthewiz opened this issue Jan 9, 2025 · 0 comments

Comments

@wikthewiz
Copy link

Describe the bug
In the binder CaffeineCacheMetrics.java (the metric cache.load.duration metric) uses a TimeGauge to store the value reported from method in totalLoadTime() in caffeine, which is an ever growing value: (https://www.javadoc.io/doc/com.github.ben-manes.caffeine/caffeine/2.2.2/com/github/benmanes/caffeine/cache/stats/CacheStats.html#totalLoadTime--).

Environment
I found this in our production environment

  • micrometer version: 1.12.4 but it is present in the latest version also
  • Prometheus
  • Linux
  • openjdk 21.0.4 2024-07-16 LTS

To Reproduce

TimeGauge.builder("cache.load.duration", cache, TimeUnit.NANOSECONDS, c -> c.stats().totalLoadTime())

Expected behavior
The expected behaviour is to have the cache.load.duration as a meter of Counter Type.

Additional context
I asked in the slack channel about this and @jonatan-ivanov kindly answered and asked me to report this a as bug. He also had some good suggestions on how what type to use. Here is a link to that answer: https://micrometer-metrics.slack.com/archives/C98P1USPR/p1736375533224759?thread_ts=1736323360.611049&cid=C98P1USPR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant