From f5183f5ed69938e24b5fac83c7e513cbecd87f5b Mon Sep 17 00:00:00 2001 From: Alexander Marshalov <_@marshalov.org> Date: Mon, 8 May 2023 13:32:51 +0200 Subject: [PATCH] fixed `vm_promscrape_config_last_reload_successful` metric value recovery after successful reloading with unchanged content (#4260) (#4268) Signed-off-by: Alexander Marshalov <_@marshalov.org> --- docs/CHANGELOG.md | 1 + lib/promscrape/scraper.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index da61dd8b1e..7fc77159b6 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -25,6 +25,7 @@ The following tip changes can be tested by building VictoriaMetrics components f * BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): add `__meta_kubernetes_endpoints_name` label for all ports discovered from endpoint. Previously, ports not matched by `Service` did not have this label. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4154) for details. Thanks to @thunderbird86 for discovering and [fixing](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/4253) the issue. * BUGFIX: fix possible infinite loop during `indexdb` rotation when `-retentionTimezoneOffset` command-line flag is set and the local timezone is not UTC. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4207). Thanks to @faceair for [the fix](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/4206). * BUGFIX: [alerts-health](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/deployment/docker/alerts-health.yml): update threshold for `TooHighMemoryUsage` alert from 90% to 80%, since 90% is too high for production environments. +* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): properly handle the `vm_promscrape_config_last_reload_successful` metric after config reload. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4260). * BUGFIX: [stream aggregation](https://docs.victoriametrics.com/stream-aggregation.html): suppress `series after dedup` error message in logs when `-remoteWrite.streamAggr.dedupInterval` command-line flag is set at [vmagent](https://docs.victoriametrics.com/vmgent.html) or when `-streamAggr.dedupInterval` command-line flag is set at [single-node VictoriaMetrics](https://docs.victoriametrics.com/). ## [v1.87.5](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.87.5) diff --git a/lib/promscrape/scraper.go b/lib/promscrape/scraper.go index ff1666b783..9a681118d7 100644 --- a/lib/promscrape/scraper.go +++ b/lib/promscrape/scraper.go @@ -159,6 +159,7 @@ func runScraper(configFile string, pushData func(at *auth.Token, wr *prompbmarsh goto waitForChans } if bytes.Equal(data, dataNew) { + configSuccess.Set(1) logger.Infof("nothing changed in %q", configFile) goto waitForChans } @@ -176,6 +177,7 @@ func runScraper(configFile string, pushData func(at *auth.Token, wr *prompbmarsh goto waitForChans } if bytes.Equal(data, dataNew) { + configSuccess.Set(1) // Nothing changed since the previous loadConfig goto waitForChans }