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

前端 未结 2 1731
不思量自难忘°
不思量自难忘° 2021-01-31 14:21

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 endp

相关标签:
2条回答
  • 2021-01-31 14:59

    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: "*"
    
    0 讨论(0)
  • 2021-01-31 15:02

    I will add that for Spring Boot 2 the actuator security has been changed (for 1.X the security for actuator has separate configuration what often cause problems when it mixes with user configuration). For Spring Boot 2.X the actuator won't have separate security config. According to Spring documentation:

    For security purposes, all actuators other than /health and /info are disabled by default. The management.endpoints.web.expose flag can be used to enable the actuators. If Spring Security is on the classpath and no other WebSecurityConfigurerAdapter is present, the actuators are secured by Spring Boot auto-config. If you define a custom WebSecurityConfigurerAdapter, Spring Boot auto-config will back off and you will be in full control of actuator access rules.)

    0 讨论(0)
提交回复
热议问题