Health Indicator
配置服务器带有一个健康指标,它可以检查已配置的 EnvironmentRepository
是否正常工作。默认情况下,它会让 EnvironmentRepository
查找一个名为 app
的应用程序、default
配置文件和 EnvironmentRepository
实现提供的默认标签。
Config Server comes with a Health Indicator that checks whether the configured EnvironmentRepository
is working.
By default, it asks the EnvironmentRepository
for an application named app
, the default
profile, and the default label provided by the EnvironmentRepository
implementation.
您可以按照下面的示例来配置健康指标,以检查更多的应用程序(以及自定义配置和自定义标签):
You can configure the Health Indicator to check more applications along with custom profiles and custom labels, as shown in the following example:
spring:
cloud:
config:
server:
health:
repositories:
myservice:
label: mylabel
myservice-dev:
name: myservice
profiles: development
可以通过将 management.health.config.enabled=false
设为 false
,来禁用健康指标。
You can disable the Health Indicator by setting management.health.config.enabled=false
.
另外,可以通过将 spring.cloud.config.server.health.down-health-status
属性设为自己的自定义 down
状态来提供(默认值为 "DOWN"
)。
Also, you can provide a custom down
status of your own by setting property spring.cloud.config.server.health.down-health-status
(valued to "DOWN'
by default).