You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Dropwizard Health功能中暴露message属性?

问题:如何让Dropwizard的Health端点返回包含message属性?

已注册的Health Checks会在localhost:8081/healthcheck端点返回结果,其中包含message属性:

{
  "worker-alive": {
    "healthy":false,
    "message":"I am not alive failure count =2",
    "duration":0,
    "timestamp":"2024-05-08T11:26:15.079Z"
  }
}

但通过Health功能配置健康检查后,请求localhost:8080/health-check?name=all&type=ALIVE端点返回的结果里没有message属性:

[
  {
    "name":"worker-alive",
    "healthy":false,
    "type":"ALIVE",
    "critical":true
  }
]

我认为这个响应是由以下类生成的:

  • ScheduledHealthCheck
  • HealthStateView
  • JsonHealthResponseProvider

请问有没有办法让localhost:8080/health-check?name=all&type=ALIVE的返回结果包含message属性?


内容的提问来源于stack exchange,提问作者rmf

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.24 13:42:37