From fa9c5c5940a01798ed561f7c5b169b62873246a7 Mon Sep 17 00:00:00 2001 From: Qifei Wan Date: Tue, 3 Aug 2021 17:55:29 +0800 Subject: [PATCH] app/vmalert: update config state metrics if config parsed failed (#1507) --- app/vmalert/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/vmalert/main.go b/app/vmalert/main.go index faea8350d..7e1ae5fad 100644 --- a/app/vmalert/main.go +++ b/app/vmalert/main.go @@ -266,6 +266,8 @@ func configReload(ctx context.Context, m *manager, groupsCfg []config.Group) { } newGroupsCfg, err := config.Parse(*rulePath, *validateTemplates, *validateExpressions) if err != nil { + configReloadErrors.Inc() + configSuccess.Set(0) logger.Errorf("cannot parse configuration file: %s", err) continue }