I added the compileOnly 'org.springframework.boot:spring-boot-starter-actuator' to my build.gradle, in the Gradle tools window I then right clicked the project and selected Refresh Gradle Dependencies. I then added endpoints.health.enabled=true to my application.properties.
When I start my application and do a GET on URL http://localhost:9000/application/health I get the following:
{
"timestamp": "2021-11-05T11:40:13.663 00:00",
"path": "/application/",
"status": 404,
"error": "Not Found",
"message": null,
"requestId": "c8352103-2"
}
Have I missed something when enabling Actuators?
CodePudding user response:
Assuming you are using Spring Boot 2.x, by default, all Actuator endpoints are placed under the /actuator path, so please try http://localhost:9000/actuator/health instead. If application is indeed part of your context path, then try http://localhost:9000/application/actuator/health.
Also, compileOnly 'org.springframework.boot:spring-boot-starter-actuator' should be implementation 'org.springframework.boot:spring-boot-starter-actuator'.
