【问题标题】:No effect when setting endpoints.health.sensitive=false in spring boot actuator在 spring boot 执行器中设置 endpoints.health.sensitive=false 时无效
【发布时间】:2016-08-18 05:13:29
【问题描述】:

在我的 application.yml 中:

endpoints:
  restart:
    enabled: true
  shutdown:
    enabled: true
  health:
    sensitive: false

但是当我请求 /health 时,我总是只得到:

{"status":"UP"}

有获取更多信息的想法吗?

【问题讨论】:

  • 请添加更多上下文。
  • 对于“未开启安全性”的我来说,只需设置 endpoints.trace.sensitive: false 就足够了...

标签: spring spring-boot actuator


【解决方案1】:

您是否尝试过访问其他端点?

我认为执行器端点启用了安全性,因此无法访问完整内容,要访问完整内容,您必须禁用执行器的安全性或必须使用基本身份验证凭据才能访问它。

要禁用安全性,请在 application.yml 中添加以下内容 -

management:
   security:
           enabled: false

【讨论】:

    【解决方案2】:

    在'application.properties'中添加:

    management.endpoint.health.show-details=always
    

    如果您需要更多信息,请查看this link,当然,我建议您阅读相关内容,了解发生了什么。

    希望对你有帮助:)

    【讨论】:

      【解决方案3】:

      来自http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#production-ready-endpoints

      health
      
      Shows application health information (when the application is secure, a simple ‘status’ when accessed over an unauthenticated connection or full message details when authenticated).
      

      您是否使用任何类型的身份验证?

      注意:默认情况下,sensitive 为 false,因此覆盖 health.sensitive 没有用。

      【讨论】:

        猜你喜欢
        • 2020-02-17
        • 1970-01-01
        • 2014-02-11
        • 1970-01-01
        • 2014-04-07
        • 2020-07-11
        • 2022-11-02
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多