FYI I did open a stack overflow and haven't heard: https://stackoverflow.com/questions/76831674/liveness-and-readiness-states-not-updating-with-additional-include

Note: SpringBoot version 2.7.12

Since updating my application.properties to include management.endpoint.health.group.liveness.include=livenessState,db management.endpoint.health.group.readiness.include=readinessState,db

I'm running into issues with status and liveness/readiness state updating correctly.

In manual testing I tried running my application and taking down the database, which made status return DOWN (as it should) but livenessstate/readinessstate showed UP (see below)

This does not seem like expected behavior.

{
"status": "DOWN",
"components": {
    "db": {
        "status": "DOWN",
        "components": {
            "mainDb": {
                "status": "DOWN",
                "details": {
                    "error": "org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30002ms."
                }
            },
            "streamingDs": {
                "status": "DOWN",
                "details": {
                    "error": "org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLTransientConnectionException: HikariPool-2 - Connection is not available, request timed out after 30001ms."
                }
            }
        }
    },
    "livenessState": {
        "status": "UP"
    }
}

Comment From: wilkinsona

livenessState and readinessState are individual components of the liveness group and the readiness group respectively. In the output above, the overall status of the group is DOWN. This is correct. It's the the aggregation of db status (DOWN) and livenessState status (UP).