mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-10 15:14:09 +00:00
vmalert: continue to print errors for bad config during hot reload (#1871)
Previously, vmalert would print an err message and set vmalert_config_last_reload_successful=0 only once during a hot reload of a bad config. Such behaviour may result into non noticed event of a bad config reload attempt Now, it continues to print error messages and keep vmalert_config_last_reload_successful state until successful attempt will be made or config state will be rolled back to prev state. Signed-off-by: hagen1778 <roman@victoriametrics.com>
This commit is contained in:
parent
48fb972ddc
commit
83c46eaf1a
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue