From 146b22d196f9396abfb12900fbe4a16966b63cf5 Mon Sep 17 00:00:00 2001 From: Julien Date: Fri, 20 Sep 2024 13:38:05 +0200 Subject: [PATCH] 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 --- cmd/prometheus/main.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/prometheus/main.go b/cmd/prometheus/main.go index 24e666cb6..e7fd82e6f 100644 --- a/cmd/prometheus/main.go +++ b/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.")