I have added the following dependency to my Spring Boot project
implementation 'io.github.resilience4j:resilience4j-spring-boot2:0.14.1'
When a circuit breaker opens, I get the following response on my actuator/health endpoint, with status code 503 Service Unavailable:
{
"status": "DOWN",
"details": {
"diskSpace": {
"status": "UP",
"details": {
"total": 499963174912,
"free": 432263229440,
"threshold": 10485760
}
},
"refreshScope": {
"status": "UP"
},
"getFlightInfoCircuitBreaker": {
"status": "DOWN",
"details": {
"failureRate": "100.0%",
"failureRateThreshold": "2.0%",
"maxBufferedCalls": 1,
"bufferedCalls": 1,
"failedCalls": 1,
"notPermittedCalls": 1,
"state": "OPEN"
}
}
}
}
My AWS ECS container health check uses this endpoint to determine its health, and restarts the container on a non-200 response.
As I do not want my service to be restarted when a circuit breaker opens, is there a way to have a circuit breaker being open, without causing the status of the service to be down?
I am aware of the registerHealthIndicator: false
property to get round this issue, but this removes the circuit breaker stats from actuator, which I would still like to see.
The CircuitBreaker uses a sliding window to store and aggregate the outcome of calls. You can choose between a count-based sliding window and a time-based sliding window. The count-based sliding window aggregrates the outcome of the last N calls.
Spring Boot's 'Actuator' dependency is used to monitor and manage the Spring web application. We can use it to monitor and manage the application with the help of HTTP endpoints or with the JMX.
Spring Boot Actuator module helps you monitor and manage your Spring Boot application by providing production-ready features like health check-up, auditing, metrics gathering, HTTP tracing etc. All of these features can be accessed over JMX or HTTP endpoints.
Spring Boot Actuator is not working because the spring boot actuator dependency is incorrect or the actuator isn't configured properly in the application. properties file. If the spring boot starter actuator is not configured, endpoints like health, info, shutdown, refresh, env, and metrics may not work.
Since 1.2.0 you can set the allowHealthIndicatorToFail to false
for this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With