Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable all endpoints in actuator (Spring Boot 2.0.0 RC1)

I moved to Spring Boot 2.0.0 RC1 from 1.5.10 and I am stuck with actuator in the latest version. How can I enable expose and enable all actuator endpoints?

The only endpoints that get exposed are:

{   "_links": {     "self": {       "href": "http://127.0.0.1:8080/actuator",       "templated": false     },     "health": {       "href": "http://127.0.0.1:8080/actuator/health",       "templated": false     },     "info": {       "href": "http://127.0.0.1:8080/actuator/info",       "templated": false     }   } } 

This is my application.properties files. Any ideas?

#The three first ones seem to be obsolete endpoints.configprops.enabled=true endpoints.beans.enabled=true endpoints.shutdown.enabled=true  management.endpoints.enabled-by-default=true management.endpoints.sensitive=false management.endpoints.enabled=true  management.endpoint.configprops.enabled=true management.endpoint.beans.enabled=true management.endpoint.shutdown.enabled=true  management.endpoints.web.exposure.include=* 
like image 646
Witold Kaczurba Avatar asked Feb 21 '18 08:02

Witold Kaczurba


People also ask

How do you turn on all actuator endpoints in spring boot 2?

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.

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.

How do you turn off all actuator endpoints in spring boot?

Spring Boot disable EndpointsOnce you add the Spring actuator dependency in your project, it enables all the actuator endpoints by default except for shutdown. To configure the enablement of an endpoint, use its management. endpoint. <id>.


1 Answers

With Spring Boot 2.0.0.RC1, actuator endpoints must be 1) enabled and 2) exposed.

By default, all endpoints but shutdown are enabled and only health and info are exposed.

In your case, the following should work:

management.endpoints.web.expose=* # if you'd like to expose shutdown: # management.endpoint.shutdown.enabled=true 

Note that this changes (again!) as of Spring Boot 2.0.0.RC2:

management.endpoints.web.exposure.include=* # if you'd like to expose shutdown: # management.endpoint.shutdown.enabled=true 

In doubt, the dedicated migration guide is always up-to-date with the latest changes.

Edit

For easy copy and paste, here's the `yaml´ versions - as of Spring Boot 2.0.0.RC2:

management:   endpoints:     web:       exposure:         include: "*" 

before:

management:   endpoints:     web:       expose: "*" 
like image 75
Brian Clozel Avatar answered Sep 23 '22 06:09

Brian Clozel