为什么 /health 的 "readinessState" 详细信息与就绪探测状态不同?

Why is the "readinessState" detail of /health different from the readiness probe status?

在 Spring-Boot 2.4 中,执行器运行状况端点和就绪探测器存在这个问题。当我的自定义关键组件之一出现故障时,/health/readiness 端点显示 DOWN/health 端点也显示, readinessState /health 的详细信息仍然显示 UP

为什么会这样? readinessState不应该也说DOWN吗?

None 我在网上找到的许多教程似乎都解决了这个问题。

我的假设:readinessState与准备无关,暴露了另一条信息。我希望我是错的,因为那将是无稽之谈,而且我对 the code 的理解似乎表明并非如此。


关于我的配置的更多信息:

相关摘录自application.yml

management:
  endpoints:
    web:
      base-path: /
  endpoint:
    health:
      show-details: ALWAYS
      probes:
        enabled: true
      group:
        readiness:
          include: db, myCustom, diskSpace

当我让 myCustom 转到 DOWN 时,会出现以下结果:

GET /health

{
    "status": "DOWN",
    "components": {
        ...,  // other components
        "myCustom": {
            "status": "DOWN"
        },
        "readinessState": {
            "status": "UP"  // here UP
        }
    },
    "groups": [
        "liveness",
        "readiness"
    ]
}

GET /health/readiness

{
    "status": "DOWN",  // but here DOWN
    "components": {
        ...,  // other components
        "myCustom": {
            "status": "DOWN"
        }
    }
}

就绪状态只监控特定的健康组。需要告知您的自定义组件。

By default, Spring Boot does not add other Health Indicators to these groups.

https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#production-ready-kubernetes-probes-external-state