Hello.
Open JDK 17 spring-boot 3.2.1 spring-boot-actuator 3.2.1
Just trying to call health checks for ElasticSearch and Redis. Both Indicators (rg.springframework.boot.actuate.data.redis.RedisHealthIndicator and org.springframework.boot.actuate.elasticsearch.ElasticsearchRestClientHealthIndicator) extend the same org.springframework.boot.actuate.health.AbstractHealthIndicator.
application.properties contains the following regarding health:
management.security.enabled = false
management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=always
I didn't include management.health.redis.enabled=true - that's the default value.
So when http://localhost:8080/actuator/health is invoked I do receive the following:
{
"status": "UP",
"components": {
"diskSpace": {
"status": "UP",
"details": {
"total":,
"free":,
"threshold":,
"path": " <some path>",
"exists": true
}
},
"elasticsearch": {
"status": "UP",
"details": {
"cluster_name": "docker-cluster",
"status": "green",
"timed_out": false,
"number_of_nodes": 1,
"number_of_data_nodes": 1,
"active_primary_shards": 626,
"active_shards": 626,
"relocating_shards": 0,
"initializing_shards": 0,
"unassigned_shards": 0,
"delayed_unassigned_shards": 0,
"number_of_pending_tasks": 0,
"number_of_in_flight_fetch": 0,
"task_max_waiting_in_queue_millis": 0,
"active_shards_percent_as_number": 100
}
},
"ping": {
"status": "UP"
}
}
}
I tried to debug ElasticsearchRestClientHealthIndicator and RedisHealthIndicator and indeed - ElasticsearchRestClientHealthIndicator.doHealthCheck is invoked but Redis is not.
And RedisHealthIndicator looks incompatible but Elastic one is OK (pls see the screen shots). Tried to find solution probably with versions compatibility - no success.
So the question is - why Redis Health is not invoked and how to resolve that? Thx a lot in advance. Appreciate any help.
Have a nice day BR Andrei
Comment From: bclozel
It is likely a configuration issue with your application. Can you run the application in debug mode (setting debug=true in application.properties for example) and provide here the auto-configuration report that is printed in the console when the application starts? The relevant auto-configuration classes should show why some conditions did not match and the endpoint is not contributed to the application.
Comment From: korotkikhandrey
Hello @bclozel Here it is. ConfigReport.log Thx a lot
Comment From: bclozel
The endpoint is not present because Spring Data Redis is not present. For further questions, please use StackOverflow.
RedisHealthContributorAutoConfiguration:
Did not match:
- @ConditionalOnClass did not find required class 'org.springframework.data.redis.connection.RedisConnectionFactory' (OnClassCondition)