app/vmalert: update config state metrics if config parsed failed (#1507)

This commit is contained in:
Qifei Wan 2021-08-03 17:55:29 +08:00 committed by GitHub
parent 370fe9fa2a
commit fa9c5c5940
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -266,6 +266,8 @@ func configReload(ctx context.Context, m *manager, groupsCfg []config.Group) {
} }
newGroupsCfg, err := config.Parse(*rulePath, *validateTemplates, *validateExpressions) newGroupsCfg, err := config.Parse(*rulePath, *validateTemplates, *validateExpressions)
if err != nil { if err != nil {
configReloadErrors.Inc()
configSuccess.Set(0)
logger.Errorf("cannot parse configuration file: %s", err) logger.Errorf("cannot parse configuration file: %s", err)
continue continue
} }