Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot 2 Actuator Metrics Cache

I have some caches

@Service
@CacheConfig(cacheNames = "myCache")
public class MyService { ... }

@Service
@CacheConfig(cacheNames = "myOtherCache")
public class MyOtherService { ... }

I get with "/actuator/metrics/cache.gets"

{
  "name" : "cache.gets",
  "measurements" : [ {
    "statistic" : "COUNT",
    "value" : 5.0
  } ],
  "availableTags" : [ {
    "tag" : "result",
    "values" : [ "hit", "miss" ]
  }, {
    "tag" : "cache",
    "values" : [ "myCache", "myOtherCache" ]
  }, {
    "tag" : "name",
    "values" : [ "myCache", "myOtherCache" ]
  }, {
    "tag" : "cacheManager",
    "values" : [ "cacheManager" ]
  } ]
}

how can I obtain the hit and miss values for myCache and myOtherCache?

like image 629
Hans Holzbart Avatar asked Oct 22 '25 03:10

Hans Holzbart


1 Answers

You should use the tags as explained here : http://blog.davidvassallo.me/2018/03/13/drill-down-into-spring-boot-actuator-metrics/

GET .../actuator/metrics/cache.gets?tag=name:myCache
GET .../actuator/metrics/cache.gets?tag=name:myOtherCache
like image 189
jaudo Avatar answered Oct 24 '25 14:10

jaudo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!