最近我将spring-boot-starter-actuator更新为2.2.2,当我使用/health
端点时,我得到了:
{
"groups": [],
"status": {
"code": "UP",
"description": ""
}
}
而不是:
{
"status": "UP"
}
而且我对此一无所知。任何想法?或者如何将输出json重新格式化为原始格式?不覆盖HealthIndicator,仅重新格式化。
提前感谢。
/actuator/health
端点已通过以下方式更改了结果JSON格式:将第一级元素的details
重命名为components
。这个有助于区分由客户返回的实际详细信息HealthIndicator
由组成复合的成分指标健康。作为更改的结果,执行器介质类型被碰撞从
application/vnd.spring-boot.actuator.v2+json
到application/vnd.spring-boot.actuator.v3+json
。如果您有工具需要使用旧格式时,可以使用HTTP Accept:标头V2媒体类型为application/vnd.spring-boot.actuator.v2+json
。