tri*_*bal 1 spring spring-boot spring-boot-actuator
最近我将 spring-boot-starter-actuator 更新到 2.2.2,当我使用端点时,/health我得到:
{
"groups": [],
"status": {
"code": "UP",
"description": ""
}
}
Run Code Online (Sandbox Code Playgroud)
代替:
{
"status": "UP"
}
Run Code Online (Sandbox Code Playgroud)
我不知道其中的原因。任何想法?或者如何将输出 json 重新格式化为原始格式?不覆盖 HealthIndicator,仅重新格式化。
提前致谢。
Spring Actuator 2.2 Health Endpoint JSON文档说:
端点已通过将第一级元素重命名为来更改
/actuator/health生成的 JSON 格式。这有助于将 a 返回的实际详细信息与 构成复合运行状况的组件指标区分开来。detailscomponentsHealthIndicator由于此更改,执行器介质类型已从 更改
application/vnd.spring-boot.actuator.v2+json为application/vnd.spring-boot.actuator.v3+json。如果您有需要使用旧格式的工具,则可以使用 HTTP Accept: 标头以及 V2 媒体类型application/vnd.spring-boot.actuator.v2+json.
另外如果你想查看所有相关的文档health是什么groups?如何自定义health indicator查看
当前健康信息
| 归档时间: |
|
| 查看次数: |
1213 次 |
| 最近记录: |