Currently, when you set management.endpoint.health.show-details to always, you will have both liveness and readiness showing details.

This is quite annoying as when you have some dependencies such as mongo, the health probe pings the database with a timeout of 30s; the consequence of it is double when your database is down

  • the liveness probe will be down and k8s will restart your container
  • the answer will come with a timeout of 30s

I tried to set management.endpoint.health.group.liveness.show-details to never; the consequence of it is that it does not output the mongo status yet it executes it as the answer comes with a DOWN status without any details but with 30s of delay.

This is quite strange as the documentation says

By default, Spring Boot does not add other health indicators to these groups.

Currently the only workaround I found is setting something like management.endpoint.health.group.liveness.include[0]=diskSpace to force the health state group to not inherit health components.

I made a demo project

I also reported the issue on spring data mongo side

Comment From: bclozel

What you're showing here is the expected behavior.

management.endpoint.health.group.liveness.show-details=always

This will implicitly create a custom group named "liveness", including all the health indicators available (since you haven't declared which indicator should be included).

Removing the former and activating the liveness health group will show the expected behavior:

management.endpoint.health.probes.enabled=true

Comment From: wilkinsona

Also see https://github.com/spring-projects/spring-boot/issues/40268, which I think this issue duplicates.

Comment From: antechrestos

@bclozel nope I set management.endpoint.health.group.liveness.show-details=never and management.endpoint.health.show-details=always ...

Hence the title....

Comment From: bclozel

As stated by Andy, this is a duplicate of #40268. Have you tried enabling health probles with management.endpoint.health.probes.enabled=true?

Comment From: antechrestos

Yeah I agree with the duplicate and will try to look at it; I just wanted to clarify the situation