Custom path for "/actuator/health/liveness" and "/actuator/health/readiness" endpoints

62 Views Asked by At

I'm using spring-boot-starter-actuator in my Java Spring Boot application and I would like to customize some default endpoint paths provided by Actuator. For instance, I've been able to map "/actuator/prometheus" to "/metrics" by adding the following lines to the application.properties file:

management.endpoints.web.exposure.include=prometheus
management.endpoints.web.base-path=/
management.endpoints.web.path-mapping.prometheus=metrics

However, I haven't been able to find a way to map "/actuator/health/liveness" to "/healthz" and "/actuator/health/readiness" to "/readyz".

I tried to add the following lines to the application.properties file but it doesn't work:

management.endpoints.web.exposure.include=health
management.endpoints.web.path-mapping.health.liveness=healthz
management.endpoints.web.path-mapping.health.readiness=readyz

At the moment I'm thinking of not using Actuator in order to achieve those customizations. Any suggestion would be highly appreciated :)

0

There are 0 best solutions below