如何在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
相关产品推荐
相关产品推荐

