I am able to access endpoints like http://localhost:8081/health
, /status
, /env
, /metrics
, /shutdown
but not /actuator
or /loginfo
endpoints.
Getting below exception.
{"timestamp":1455929182552,"status":404,"error":"Not Found","message":"No message available","path":"/actuator"}
How to acccess http://localhost:8081/actuator endpoint?
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.
Spring Boot Actuator is not working because the spring boot actuator dependency is incorrect or the actuator isn't configured properly in the application. properties file. If the spring boot starter actuator is not configured, endpoints like health, info, shutdown, refresh, env, and metrics may not work.
You can invoke the refresh Actuator endpoint by sending an empty HTTP POST to the client's refresh endpoint: http://localhost:8080/actuator/refresh . Then you can confirm it worked by visting the http://localhost:8080/message endpoint. We set management.
As of spring boot version 2.0.1 using below property would work
management.endpoints.web.exposure.include=<comma separated endpoints you wish to expose>
You can use *
wildcard to expose all actuator endpoints over the web if security isn't your concern.
Also endpoints seems to have moved from previous versions. For ex. if you wish to use beans, you would now have /actuator/beans
endpoint.
Just to be sure look at startup logs for such endpoints.
More on endpoints can be found here
If you type http://localhost:8080/actuator/
yo'll get the list of endpoints that has been exposed by default (3 endpoint) so in order to expose all your endpoint what you have to add in your application.properties/yml
file:
management.endpoints.web.exposure.include=*
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