The metric cache.gets is configured twice in CacheMeterBinder; once on line 62 and is linked to the misses and then on line 72 and linked to the hits. Is this intentional please?
@samanthacatania Assuming that you're referring CacheMeterBinder (not CacheMeterBuilder), as you've noticed, one for misses and another for hits. Any problem with it?
@izeye You're correct I meant CacheMeterBinder. When loading the value from actuator only the hits seem to be returned.
http://localhost:8090/actuator/metrics/cache.gets
{
"name": "cache.gets",
"description": "The number of times cache lookup methods have returned a cached value.",
"measurements": [
{
"statistic": "COUNT",
"value": 3.0
}
],
"availableTags": [
{
"tag": "result",
"values": [
"hit",
"miss"
]
},
{
"tag": "appointments",
"values": [
"cache"
]
},
{
"tag": "cache",
"values": [
"appointments"
]
},
{
"tag": "name",
"values": [
"appointments"
]
},
{
"tag": "cacheManager",
"values": [
"cacheManager"
]
}
]
}
@samanthacatania http://localhost:8090/actuator/metrics/cache.gets gives you a merged result based on the meter name cache.gets.
If you want to see "hit" or "miss" result specifically, you can drill down to it by specifying tag(s) as follows:
http://localhost:8090/actuator/metrics/cache.gets?tag=result:hithttp://localhost:8090/actuator/metrics/cache.gets?tag=result:missSee the "Metrics endpoint" section in the Spring Boot reference for more details.
Closing as this is a question on Spring Boot Actuator metrics endpoint.
If you have an additional question, it'd be better to ask it on StackOverflow with tags like spring-boot, spring-boot-actuator, and micrometer.
@izeye Thanks for clarifying, it is appreciated.