健康指标
Config Server 带有一个健康指示器,用于检查配置的 EnvironmentRepository 是否正常工作。默认情况下,它会向 EnvironmentRepository 请求一个名为 app 的应用程序、default 配置文件以及 EnvironmentRepository 实现提供的默认标签。
您可以配置健康指示器,使其检查更多应用程序以及自定义配置文件和自定义标签,如以下示例所示
spring:
cloud:
config:
server:
health:
repositories:
myservice:
label: mylabel
myservice-dev:
name: myservice
profiles: development
您可以通过设置 spring.cloud.config.server.health.enabled=false 来禁用健康指示器。
此外,您可以通过设置属性 spring.cloud.config.server.health.down-health-status(默认值为 "DOWN")来提供自定义的 down 状态。
如果 spring.cloud.config.server.accept-empty 为 false 并且健康指示器检查未返回任何存储库数据,则健康指示器将返回 DOWN 状态。 |