diff --git a/app/vmalert/README.md b/app/vmalert/README.md index 4015aaa2c..4f06a6431 100644 --- a/app/vmalert/README.md +++ b/app/vmalert/README.md @@ -1243,8 +1243,6 @@ The shortlist of configuration flags is the following: See https://docs.victoriametrics.com/vmalert.html#reading-rules-from-object-storage Supports an array of values separated by comma or specified via multiple flags. - -rule.configCheckInterval duration - Interval for checking for changes in '-rule' files. By default, the checking is disabled. Send SIGHUP signal in order to force config check for changes. DEPRECATED - see '-configCheckInterval' instead -rule.maxResolveDuration duration Limits the maximum duration for automatic alert expiration, which by default is 4 times evaluationInterval of the parent group. -rule.resendDelay duration diff --git a/app/vmalert/main.go b/app/vmalert/main.go index 358dae710..5a15eff22 100644 --- a/app/vmalert/main.go +++ b/app/vmalert/main.go @@ -55,9 +55,6 @@ absolute path to all .tpl files in root. -rule.templates="dir/**/*.tpl". Includes all the .tpl files in "dir" subfolders recursively. `) - rulesCheckInterval = flag.Duration("rule.configCheckInterval", 0, "Interval for checking for changes in '-rule' files. "+ - "By default, the checking is disabled. Send SIGHUP signal in order to force config check for changes. DEPRECATED - see '-configCheckInterval' instead") - configCheckInterval = flag.Duration("configCheckInterval", 0, "Interval for checking for changes in '-rule' or '-notifier.config' files. "+ "By default, the checking is disabled. Send SIGHUP signal in order to force config check for changes.") @@ -311,10 +308,6 @@ See the docs at https://docs.victoriametrics.com/vmalert.html . func configReload(ctx context.Context, m *manager, groupsCfg []config.Group, sighupCh <-chan os.Signal) { var configCheckCh <-chan time.Time checkInterval := *configCheckInterval - if checkInterval == 0 && *rulesCheckInterval > 0 { - logger.Warnf("flag `rule.configCheckInterval` is deprecated - use `configCheckInterval` instead") - checkInterval = *rulesCheckInterval - } if checkInterval > 0 { ticker := time.NewTicker(checkInterval) configCheckCh = ticker.C diff --git a/app/vmalert/main_test.go b/app/vmalert/main_test.go index ce495df4c..ace111851 100644 --- a/app/vmalert/main_test.go +++ b/app/vmalert/main_test.go @@ -92,7 +92,7 @@ groups: } writeToFile(t, f.Name(), rules1) - *rulesCheckInterval = 200 * time.Millisecond + *configCheckInterval = 200 * time.Millisecond *rulePath = []string{f.Name()} ctx, cancel := context.WithCancel(context.Background()) @@ -117,14 +117,14 @@ groups: return len(m.groups) } - time.Sleep(*rulesCheckInterval * 2) + time.Sleep(*configCheckInterval * 2) groupsLen := lenLocked(m) if groupsLen != 1 { t.Fatalf("expected to have exactly 1 group loaded; got %d", groupsLen) } writeToFile(t, f.Name(), rules2) - time.Sleep(*rulesCheckInterval * 2) + time.Sleep(*configCheckInterval * 2) groupsLen = lenLocked(m) if groupsLen != 2 { fmt.Println(m.groups) @@ -133,7 +133,7 @@ groups: writeToFile(t, f.Name(), rules1) procutil.SelfSIGHUP() - time.Sleep(*rulesCheckInterval / 2) + time.Sleep(*configCheckInterval / 2) groupsLen = lenLocked(m) if groupsLen != 1 { t.Fatalf("expected to have exactly 1 group loaded; got %d", groupsLen) @@ -141,7 +141,7 @@ groups: writeToFile(t, f.Name(), `corrupted`) procutil.SelfSIGHUP() - time.Sleep(*rulesCheckInterval / 2) + time.Sleep(*configCheckInterval / 2) groupsLen = lenLocked(m) if groupsLen != 1 { // should remain unchanged t.Fatalf("expected to have exactly 1 group loaded; got %d", groupsLen) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 8d00e396e..916f83250 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -25,6 +25,7 @@ The following `tip` changes can be tested by building VictoriaMetrics components ## tip * FEATURE: [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html): add `share_eq_over_time(m[d], eq)` function for calculating the share (in the range `[0...1]`) of raw samples on the given lookbehind window `d`, which are equal to `eq`. See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4441). Thanks to @Damon07 for the [pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/4725). +* FEATURE: [vmalert](https://docs.victoriametrics.com/vmalert.html): remove deprecated in [v1.61.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.61.0) `-rule.configCheckInterval` command-line flag. Use `-configCheckInterval` command-line flag instead. * BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): use local scrape timestamps for the scraped metrics unless `honor_timestamps: true` option is explicitly set at [scrape_config](https://docs.victoriametrics.com/sd_configs.html#scrape_configs). This fixes gaps for metrics collected from [cadvisor](https://github.com/google/cadvisor) or similar exporters, which export metrics with invalid timestamps. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4697) and [this comment](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4697#issuecomment-1654614799) for details. The issue has been introduced in [v1.68.0](#v1680). diff --git a/docs/vmalert.md b/docs/vmalert.md index b70bfd0e8..384fd8c83 100644 --- a/docs/vmalert.md +++ b/docs/vmalert.md @@ -1254,8 +1254,6 @@ The shortlist of configuration flags is the following: See https://docs.victoriametrics.com/vmalert.html#reading-rules-from-object-storage Supports an array of values separated by comma or specified via multiple flags. - -rule.configCheckInterval duration - Interval for checking for changes in '-rule' files. By default, the checking is disabled. Send SIGHUP signal in order to force config check for changes. DEPRECATED - see '-configCheckInterval' instead -rule.maxResolveDuration duration Limits the maximum duration for automatic alert expiration, which by default is 4 times evaluationInterval of the parent group. -rule.resendDelay duration