为什么在运行时忽略属性值“ management.endpoint.health.show-details”的更改?

时间:2019-05-15 15:53:34

标签: spring-cloud spring-boot-actuator spring-cloud-consul

我正在使用Spring Cloud Consul来管理应用程序的配置(Spring Boot:v2.1.4.RELEASE) 在上传到Consul的文件“ application.yml”中,我对Actuator进行了以下配置:

management:
  endpoints:
    web:
      exposure:
        include: "*"
  endpoint:
    health:
      show-details: ALWAYS

这将显示有关/ actuator / health端点的详细信息。

当我在应用程序运行时将Consul中的此属性更改为'NEVER'时,将注意到更改,并刷新了该属性,可以在两个地方检查到此:

1)日志

2019-05-15 16:07:52.355  INFO 11020 --- [TaskScheduler-1] b.c.PropertySourceBootstrapConfiguration : Located property source: CompositePropertySource {name='consul', propertySources=[ConsulFilesPropertySource {name='configuration/application.yml'}]}
2019-05-15 16:07:52.366  INFO 11020 --- [TaskScheduler-1] o.s.boot.SpringApplication               : No active profile set, falling back to default profiles: default
2019-05-15 16:07:52.378  INFO 11020 --- [TaskScheduler-1] o.s.boot.SpringApplication               : Started application in 2.284 seconds (JVM running for 128.176)
2019-05-15 16:07:52.468  INFO 11020 --- [TaskScheduler-1] o.s.c.e.event.RefreshEventListener       : Refresh keys changed: [management.endpoint.health.show-details]

2)端点/actuator/configprops

                "management.endpoint.health-org.springframework.boot.actuate.autoconfigure.health.HealthEndpointProperties": {
                    "prefix": "management.endpoint.health",
                    "properties": {
                        "showDetails": "NEVER",
                        "roles": []
                    }
                },

问题是/actuator/health端点仍在提供运行状况详细信息,而忽略了对运行时属性“ management.endpoint.health.show-details”所做的更改。

是否应该应用其他配置?

0 个答案:

没有答案
相关问题