健康指標
Config Server 提供了一個健康指標,用於檢查配置的 EnvironmentRepository
是否正常工作。預設情況下,它會向 EnvironmentRepository
請求名為 app
的應用、default
profile 以及 EnvironmentRepository
實現提供的預設標籤。
您可以配置健康指標以檢查更多應用以及自定義 profile 和自定義標籤,示例如下:
spring:
cloud:
config:
server:
health:
repositories:
myservice:
label: mylabel
myservice-dev:
name: myservice
profiles: development
您可以透過設定 management.health.config.enabled=false
來停用健康指標。
此外,您還可以透過設定屬性 spring.cloud.config.server.health.down-health-status
來提供自定義的 down
狀態(預設為 "DOWN"
)。