Closed shellrausch closed 1 year ago
Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.
Here the ready to run example: https://github.com/shellrausch/r4j-springboot3-no-metrics
Steps to reproduce:
resilience4j_timelimiter_calls_total
Looks like this is something to do with the OpenFeign Integration.
Using Boot 2.7 and Spring Cloud 2021 this is what I see
# HELP resilience4j_timelimiter_calls_total The number of successful calls
# TYPE resilience4j_timelimiter_calls_total counter
resilience4j_timelimiter_calls_total{group="none",kind="timeout",name="httpbin",} 0.0
resilience4j_timelimiter_calls_total{group="HttpBinClient#getSomeData()",kind="timeout",name="HttpBinClient#getSomeData()",} 0.0
resilience4j_timelimiter_calls_total{group="HttpBinClient#getSomeData()",kind="successful",name="HttpBinClient#getSomeData()",} 2.0
resilience4j_timelimiter_calls_total{group="none",kind="successful",name="httpbin",} 0.0
resilience4j_timelimiter_calls_total{group="none",kind="failed",name="httpbin",} 0.0
resilience4j_timelimiter_calls_total{group="HttpBinClient#getSomeData()",kind="failed",name="HttpBinClient#getSomeData()",} 0.0
In Boot 3 with Spring Cloud 2022, I don't see the metrics as you indicated when using OpenFeign but when you use Spring Cloud CircuitBreaker directly I do see the metrics
# HELP resilience4j_timelimiter_calls_total The number of successful calls
# TYPE resilience4j_timelimiter_calls_total counter
resilience4j_timelimiter_calls_total{group="httpbinwithoutfeign",kind="timeout",name="httpbinwithoutfeign",} 0.0
resilience4j_timelimiter_calls_total{group="httpbinwithoutfeign",kind="successful",name="httpbinwithoutfeign",} 1.0
resilience4j_timelimiter_calls_total{group="httpbinwithoutfeign",kind="failed",name="httpbinwithoutfeign",} 0.0
resilience4j_timelimiter_calls_total{group="none",kind="timeout",name="httpbin",} 0.0
resilience4j_timelimiter_calls_total{group="none",kind="successful",name="httpbin",} 0.0
resilience4j_timelimiter_calls_total{group="none",kind="failed",name="httpbin",} 0.0
The difference appears to be in the group attribute, that is no longer there in Spring Cloud OpenFeign 2022.
@OlgaMaciaszek does anything pop out to you right away on why this might be? If not I can try and track down then difference
Other than this change you've added : https://github.com/spring-cloud/spring-cloud-openfeign/blob/7ad582dbe98484a5b35187166c2b3a10a8f9084a/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/FeignAutoConfiguration.java#L189-L195. Not sure if this could have anything to do with that issue @ryanjbaxter ?
No I don't think that would do it, at least its not obvious to me. I will have to look into it.
I figured out the problem.
@shellrausch you need to change feign.circuitbreaker.enabled=true
to spring.cloud.openfeign.circuitbreaker.enabled=true
. The property prefix changed in the 2022 release.
Spring Boot version: 3.0.1 Spring Cloud version: 2022.0.0 Java version: 17
After updating to Spring Boot 3 many of the metrics stays always at 0.0:
My dependencies:
The config: