spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

"spring.cloud.gateway.requests" metric not incremented for subsequent cached responses

Open ipalbeniz opened this issue 1 year ago • 0 comments

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

  1. Run the attached demo-gateway.zip application.
  2. Call the route (http://localhost:8080/ip) using curl 5 times: curl http://localhost:8080/ip
  3. Check the spring.cloud.gateway.requests metric using: curl http://localhost:8080/actuator/metrics/spring.cloud.gateway.requests | jq.
  4. You will likely see that the COUNT measurement remains at 1, even though the route was called 5 times.

ipalbeniz avatar Apr 10 '24 11:04 ipalbeniz