spring-cloud-gateway
spring-cloud-gateway copied to clipboard
"spring.cloud.gateway.requests" metric not incremented for subsequent cached responses
Describe the bug
I'm encountering an issue with the spring.cloud.gateway.requests metric not being incremented for subsequent calls to a route using LocalResponseCache filter.
Expected behavior I expect the metric to be incremented for each request, regardless of whether the response is served from the cache.
Sample
- Run the attached demo-gateway.zip application.
- Call the route (http://localhost:8080/ip) using curl 5 times:
curl http://localhost:8080/ip - Check the
spring.cloud.gateway.requestsmetric using:curl http://localhost:8080/actuator/metrics/spring.cloud.gateway.requests | jq. - You will likely see that the
COUNTmeasurement remains at 1, even though the route was called 5 times.