Skip to content

Cache Metrics Broken on JDK > 11 #605

Description

@broadcom-tony

Expected Behavior

All caching metrics should work cache_size, cache_puts, hits, etc.

Actual Behaviour

cache_size metrics work but cache_puts, hits, etc do not increment. This issue describes the behavior:

#94

I believe the issue is that javax was pulled out of the JDK in version 11 and greater however the JCacheMetricsBinder.java and potentially other places @require javax.cache.CacheManager to load their bean.

See:

https://github.com/micronaut-projects/micronaut-cache/blob/master/cache-core/src/main/java/io/micronaut/cache/jcache/metrics/JCacheMetricsBinder.java#L42

Steps To Reproduce

No response

Environment Information

  • Linux/MacOs
  • JDK 17

`
id "io.micronaut.minimal.application" version "3.7.8"
micronaut {
version = "3.9.1"
}
implementation "io.micronaut.micrometer:micronaut-micrometer-core"
implementation "io.micronaut.micrometer:micronaut-micrometer-registry-prometheus"
implementation "io.micronaut.cache:micronaut-cache-core"
implementation "io.micronaut.cache:micronaut-cache-caffeine"

`

Example Application

No response

Version

3.9.1

Metadata

Metadata

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions