Actuator Exposing Endpoints not working

牧云@^-^@ 提交于 2021-02-10 15:53:49

问题


I am using spring boot 2.0.4 and want to expose my actuator endpoints. When adding the following to application.yml only info, health are being exposed.

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

When I run http://localhost:8080/actuator I get

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

回答1:


Spring Boot 2.0 takes a slightly different approach to ensure web endpoints security. The majority of Web endpoints are now disabled by default (Only the /health and /info endpoints are exposed) and the management.security.enabled property has been removed. There is no longer a separate security auto-configuration for the Actuator, individual endpoints may be enabled/disabled and/or exposed via configuration in the application.properties file. For example:

# disable beans endpoint  
management.endpoints.beans.enabled=false  
# expose all endpoints:
management.endpoints.web.exposure.include=*  

See additional info Spring official documentation: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Migration-Guide#endpoints



来源:https://stackoverflow.com/questions/51829253/actuator-exposing-endpoints-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!