diff --git a/app/vmalert/main.go b/app/vmalert/main.go index 775f756b2e..e0ed4ce2d8 100644 --- a/app/vmalert/main.go +++ b/app/vmalert/main.go @@ -284,13 +284,13 @@ func configReload(ctx context.Context, m *manager, groupsCfg []config.Group, sig // config didn't change - skip it continue } - groupsCfg = newGroupsCfg - if err := m.update(ctx, groupsCfg, false); err != nil { + if err := m.update(ctx, newGroupsCfg, false); err != nil { configReloadErrors.Inc() configSuccess.Set(0) logger.Errorf("error while reloading rules: %s", err) continue } + groupsCfg = newGroupsCfg configSuccess.Set(1) configTimestamp.Set(fasttime.UnixTimestamp()) logger.Infof("Rules reloaded successfully from %q", *rulePath)