英文:
Spring Boot Application Availability (Liveness and Readiness) Returns 404
问题
我有一个Spring Boot应用程序(v2.3.2),并启用了健康检查组的活动状态和准备状态:
management:
endpoints:
enabled-by-default: false
endpoint:
health:
enabled: true
probes:
enabled: true
而 GET /actuator/health
返回:
{
"groups": [
"liveness",
"readiness"
],
"status": "UP"
}
根据文档,我应该能够访问 GET /actuator/health/liveness
和 GET /actuator/health/readiness
,但两者都返回 404
。我是否漏掉了任何配置或其他内容?
英文:
I've got a Spring Boot application (v2.3.2) and enabled the actuator health group for liveness and readiness:
management:
endpoints:
enabled-by-default: false
endpoint:
health:
enabled: true
probes:
enabled: true
And GET /actuator/health
returns:
{
"groups": [
"liveness",
"readiness"
],
"status": "UP"
}
According to the documentation, I should also be able to GET /actuator/health/liveness
and GET /actuator/health/readiness
, but both return 404
.
Did I miss any configuration or something?
答案1
得分: 2
这应该可以工作
management:
endpoints:
enabled-by-default: false
endpoint:
health:
enabled: true
probes:
enabled: true
group:
liveness:
include: "livenessStateProbeIndicator"
readiness:
include: "readinessStateProbeIndicator"
这是一个因为问题而采取的临时解决措施(参考链接:https://github.com/spring-projects/spring-boot/issues/22562)
英文:
this should work
management:
endpoints:
enabled-by-default: false
endpoint:
health:
enabled: true
probes:
enabled: true
group:
liveness:
include: "livenessStateProbeIndicator"
readiness:
include: "readinessStateProbeIndicator"
it is a workaround due to an issue
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论