I'm using Spring Boot 2 M3 actuators. By default, the health endpoint is mapped to /application/health
.
/health
?In order to access the actuator endpoints using HTTP, we need to both enable and expose them. By default, all endpoints but /shutdown are enabled.
By default base-path of actuator endpoints is /actuator , we can change it to any other value by setting management. endpoints. web. base-path in application properties file.
To enable Spring Boot actuator endpoints to your Spring Boot application, we need to add the Spring Boot Starter actuator dependency in our build configuration file. Maven users can add the below dependency in your pom. xml file. Gradle users can add the below dependency in your build.
The application runs on port 8080 by default. Once the actuator has started, we can see the list of all the endpoints exposed over HTTP.
In your application.properties file add this to set the base path to '/'
management.endpoints.web.base-path=/
Path will now be '/health'
Edit: Alternatively if you are using YAML use:
management:
endpoints:
web:
base-path: /
FYI as of Spring Boot 2.0.0.RELEASE the default health endpoint is /actuator/health
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With