5

在我的 application.yml 中:

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

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

{"status":"UP"}

任何想法来获取更多信息?

4

3 回答 3

11

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

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

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

management:
   security:
           enabled: false
于 2016-09-23T10:44:36.117 回答
3

在“application.properties”中添加:

management.endpoint.health.show-details=always

如果您需要更多信息,请查看此链接,当然,我建议您阅读相关内容,以了解正在发生的事情。

希望它有帮助:)

于 2019-03-07T12:37:07.517 回答
2

来自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 没有用。

于 2016-08-19T21:34:42.950 回答