micrometer-metrics / micrometer

An application observability facade for the most popular observability tools. Think SLF4J, but for observability.
https://micrometer.io
Apache License 2.0
4.48k stars 990 forks source link

Log a warning when instrumenting a cache that is not recording stats #5066

Open keith-turner opened 6 months ago

keith-turner commented 6 months ago

Please describe the feature request. It would be nice if a warning were logged (or the user was informed in some way) when a cache is instrumented that is not recording stats.

Rationale For some Cache implementations like Caffeine recording stats is optional. When instrumenting a cache that is not recording stats the meters will constantly report 0 which could be misleading. This is probably not what the user desires.

Additional context

apache/accumulo#4552

shakuzen commented 3 months ago

That sounds like a good improvement to me. Would you or anyone else be interested in making a pull request for it?

izeye commented 2 months ago

I created https://github.com/micrometer-metrics/micrometer/pull/5402 to try to resolve this for the CaffeineCacheMetrics.