Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude redis check in spring actuator health

Service health check api response 503 when redis is down.

{
    "status": "DOWN",
    "details": {
        "diskSpace": {
            "status": "UP",
            "details": {
                "total": 250790436864,
                "free": 95412813824,
                "threshold": 10485760
            }
        },
        "db": {
            "status": "UP",
            "details": {
                "database": "PostgreSQL",
                "hello": 1
            }
        },
        "refreshScope": {
            "status": "UP"
        },
        "redis": {
            "status": "DOWN",
            "details": {
                "error": "org.springframework.data.redis.connection.PoolException: Could not get a resource from the pool; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to localhost:6379"
            }
        }
    }
}

But actually service is available when redis is down.

Could service status not be effected by redis status ? and I also need see the redis detail in health check api.

like image 270
huangydyn Avatar asked Feb 02 '26 05:02

huangydyn


1 Answers

management.health.redis.enabled=false

Add this code to disable the Redis health check in your application.yaml/properties

like image 93
Lucas Araújo Avatar answered Feb 05 '26 00:02

Lucas Araújo