【问题标题】:Unable to suppress /health in Spring boot actuator无法在 Spring Boot 执行器中抑制 /health
【发布时间】:2018-04-04 23:37:13
【问题描述】:

在我的 application.properties 上,我有 endpoints.enabled=false 和 endpoints.health.enabled=false 但 /health 端点仍然没有被抑制。

【问题讨论】:

    标签: spring spring-boot spring-boot-actuator


    【解决方案1】:

    也许您缺少第一级属性。 应该像这样配置属性,以禁用所有端点

    management.endpoints.enabled-by-default= false
    

    如果您只想禁用健康端点而不是使用此属性:

        management.endpoint.health.enabled=false
    

    【讨论】:

    • 嗨,我的项目中根本没有 Spring Security。我根本找不到这个属性 management.endpoints.enabled-by-default
    • 您能否分享有关您的环境的更多信息,例如spring boot 版本,你的application.properties的内容
    【解决方案2】:

    我认为这里的问题可能是正在使用的 Sprint Boot 版本。 1.5.x 与 2.0.x 有不同的属性。

    Spring Boot 2.0.x

    management.endpoints.enabled-by-default=false

    management.endpoint.health.enabled=false

    management.endpoint.info.enabled=true

    Spring Boot 1.5.x

    endpoints.enabled=false

    endpoint.health.enabled=false

    endpoint.info.enabled=true

    另请注意,在启用端点时,您使用复数(“endpoints”),但在启用特定端点时,您使用单例(“endpoint”)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-18
      • 1970-01-01
      • 1970-01-01
      • 2020-06-30
      • 1970-01-01
      • 2021-05-02
      • 2019-08-22
      • 2021-10-18
      相关资源
      最近更新 更多