title: Monitoring spring boot cache metrics with Prometheus
body: <p>I am trying to use prometheus to monitor some cache metrics from spring-boot.  The cache is created with <code>@Cacheable</code> and my configuration is as follows:</p>
  
  <pre><code>management.endpoints:
    web.exposure.include: "*"
    metrics.enabled: true
    prometheus.enabled: true
  management.metrics:
    export.prometheus.enabled: true
    cache.instrument: true
  </code></pre>
  
  <p>My cache is created with a simple <code>@Cacheable('mycache')</code> - I have no other cache code or setup.  <strong>I'm also NOT using any specific cache provided just the built in one.</strong></p>
  
  <p>I do see my cache in the <code>/actuator/caches/</code> list, but no detailed in either the <code>/metrics</code> or <code>/prometheus</code> endpoints.  </p>
  
  <p>My expectation was that some cache metrics would be published to both the <code>/actuator/metrics</code> and <code>/actuator/prometheus</code> endpoints.</p>
  
  <p>I saw some notes about manually needing to register the cache, but I couldn't get that working either (nor am I sure it really pertains).  When attempting to do this the issue is that I cannot autowire in the <code>CacheMetricsRegistrar</code> bean.  It's not found.</p>