3

I have a Spring Boot 2.6.0-M1 project with Jubilee (But issue can be reproduced since 2.4). In my project, I am using Actuator, Spring cloud Kubernetes, and Resilience4J (not Spring Cloud Circuit breaker)

Very happy about this combination. Resilience4J is working fine, the circuit breaker goes into open states etc. Kubernetes detect the config maps, etc... Very happy.

However, on a actuator health endpoint, I am seeing this :

"circuitBreakers":{"status":"UNKNOWN"}

And checked my configuration, management.health.circuitbreakers.enabled: true

How do I get the correct status, and not this "UNKNOWN" please?

Thank you

PatPanda
  • 3,644
  • 9
  • 58
  • 154
  • 2
    can you set the following property in your application.yml? It will show you more details when you hit the `/health` which might make it easier to understand why it is returning "UNKNOWN". `management.endpoint.health.show-details: "ALWAYS"` – Michael McFadyen Dec 16 '20 at 17:54
  • Great idea! Let me try right away – PatPanda Dec 17 '20 at 08:49
  • Still "UNKNOWN", even with management.endpoint.health.show-details: "ALWAYS" :'( – PatPanda Dec 17 '20 at 08:50

3 Answers3

2

In order to use actuator along with resilience 4j please use the configuration mentioned below.

Make sure to add your service name and it works perfectly.

resilience4j.retry.instances.customerService.max-attempts: 3
resilience4j.retry.instances.customerService.wait-duration: 5s
management.endpoint.health.show-details: "ALWAYS"        
management.health.circuitbreakers.enabled: false 
management.health.ratelimiters.enabled: true
resilience4j.circuitbreaker.configs.default.registerHealthIndicator: true
Laurel
  • 5,965
  • 14
  • 31
  • 57
2

Circuit breaker showing status unknown because you are missing one of the required properties in application.properties file.

You should add below property:

resilience4j.circuitbreaker.instances.{App Name}.registerHealthIndicator = true

Also check below properties:

management.endpoint.health.show-details: "ALWAYS"        
management.health.circuitbreakers.enabled: false 
management.health.ratelimiters.enabled: true
resilience4j.circuitbreaker.configs.default.registerHealthIndicator: true
officer
  • 2,080
  • 1
  • 20
  • 29
kanik
  • 381
  • 3
  • 6
0

UNKNOW is also a kind of state of CircuitBreaker, which means half-open state. A closed CircuitBreaker state is mapped to UP, an open state to DOWN and a half-open state to UNKNOWN. You can see explain here

Xu Perry
  • 1
  • 1