spring-data-opensearch icon indicating copy to clipboard operation
spring-data-opensearch copied to clipboard

[FEATURE] Add in actuator health indicator

Open petergphillips opened this issue 1 year ago • 2 comments

I'm not sure if this should be a feature request for this project or the spring boot actuator project since the elasticsearch indicator is provided by that project. Raising here since the spring-data-elasticsearch project is a spring project, whereas spring-data-opensearch is not, hopefully this is the right place!

Is your feature request related to a problem?

If our application is unable to connect to opensearch then we can see lots of errors in the logs such as

2023-05-17 13:16:26.135 ERROR 1862 --- [nt_sniffer[T#1]] org.opensearch.client.sniff.Sniffer      : error while sniffing nodes |  

however the application does start up and the /actuator/health endpoint shows that all is healthy status is UP. This is incorrect since the application is certainly not healthy if it can't connect to opensearch.

What solution would you like?

It would therefore be good to have a health indicator that is automatically included to indicate whether we can connect to opensearch. Note that the elasticsearch health indicator actually calls the /_cluster/health endpoint, which goes beyond checking whether we can connect to the cluster and actually lets us know the state of the cluster. If this is a relatively cheap operation then this sounds fine, otherwise some sort of ping would normally be preferable.

What alternatives have you considered?

We could write our own health indicator, but it feels like there should be something out of the box.

petergphillips avatar May 17 '23 12:05 petergphillips