Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to access Spring Boot Actuator "/actuator" endpoint

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?

like image 771
grkhyd Avatar asked Feb 20 '16 00:02

grkhyd


People also ask

How do I turn on spring boot actuator endpoints?

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.

Why is my actuator not working in spring boot?

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.

How do I enable actuator refresh endpoint?

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.


2 Answers

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

like image 118
Shanu Gupta Avatar answered Oct 11 '22 16:10

Shanu Gupta


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=* 
like image 35
BERGUIGA Mohamed Amine Avatar answered Oct 11 '22 15:10

BERGUIGA Mohamed Amine