Browse Source

fix(autoreload): Reload invalid yaml files

When a YAML file is invalid, trigger auto-reload anyway so that user is
aware that the configuration file is incorrect.

Failing to do so does not change the reload status in metrics and api.

Signed-off-by: Julien <roidelapluie@o11y.eu>
pull/14947/head
Julien 2 months ago
parent
commit
146b22d196
  1. 4
      cmd/prometheus/main.go

4
cmd/prometheus/main.go

@ -1119,9 +1119,7 @@ func main() {
currentChecksum, err := config.GenerateChecksum(cfg.configFile)
if err != nil {
level.Error(logger).Log("msg", "Failed to generate checksum during configuration reload", "err", err)
continue
}
if currentChecksum == checksum {
} else if currentChecksum == checksum {
continue
}
level.Info(logger).Log("msg", "Configuration file change detected, reloading the configuration.")

Loading…
Cancel
Save