【发布时间】:2021-09-30 11:15:56
【问题描述】:
目前,Actuator 不会检查组中的所有指标是否在上下文中可用,它还会在运行时检查时跳过不存在的指标。
例如,application.yaml - 如果我描述 checkServiceUnknown
management:
endpoint:
health:
group:
readiness:
include: checkService1, checkServiceUnknown
它只是跳过 HealthEndpointSupport 中的 checkServiceUnknown。发生这种情况是因为它由 NamedContributor 循环,而不是由组成员循环:
for (NamedContributor<C> namedContributor : namedContributors) {
String name = namedContributor.getName();
C contributor = namedContributor.getContributor();
if (group.isMember(name) || isNested) {
...
如何检查所有描述的指标是否真的会在 Spring 启动时被调用/可用?
【问题讨论】:
标签: java spring spring-boot spring-boot-actuator