Improve Prometheus metrics removal

This commit is contained in:
Marco Jantke 2018-06-05 12:32:03 +02:00 committed by Traefiker Bot
parent f317e50136
commit 2c18750537
7 changed files with 480 additions and 215 deletions

View file

@ -535,7 +535,10 @@ func (s *serverEntryPoint) getCertificate(clientHello *tls.ClientHelloInfo) (*tl
}
func (s *Server) postLoadConfiguration() {
metrics.OnConfigurationUpdate()
if s.metricsRegistry.IsEnabled() {
activeConfig := s.currentConfigurations.Get().(types.Configurations)
metrics.OnConfigurationUpdate(activeConfig)
}
if s.globalConfiguration.ACME == nil || s.leadership == nil || !s.leadership.IsLeader() {
return