From a13a443bf7d454dbcccc34febc647f296375eb64 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 15 Dec 2020 14:44:42 +0200 Subject: [PATCH 1/8] docs/CHANGELOG.md: cut v1.50.0 release --- docs/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index b8768928f..c3f9b63b4 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,9 @@ # tip + +# [v1.50.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.50.0) + * FEATURE: automatically reset response cache when samples with timestamps older than `now - search.cacheTimestampOffset` are ingested to VictoriaMetrics. This makes unnecessary disabling response cache during data backfilling or resetting it after backfilling is complete as described [in these docs](https://victoriametrics.github.io/#backfilling). This feature applies only to single-node VictoriaMetrics. It doesn't apply to cluster version of VictoriaMetrics because `vminsert` nodes don't know about `vmselect` nodes where the response cache must be reset. * FEATURE: vmalert: add `query`, `first` and `value` functions to alert templates. See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/539 * FEATURE: vmagent: return user-friendly HTML page when requesting `/targets` page from web browser. The page is returned in the old plaintext format when requesting via curl or similar tool. From 1eabbc0e27d3125368850922dc598ef37af47027 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 15 Dec 2020 18:43:41 +0200 Subject: [PATCH 2/8] docs/vmagent.md: mention that `sample_limit` option has no sense when stream parsing is enabled --- app/vmagent/README.md | 3 +++ docs/vmagent.md | 3 +++ docs/vmalert.md | 1 - 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/vmagent/README.md b/app/vmagent/README.md index 261c29f7a..6ea96dd1c 100644 --- a/app/vmagent/README.md +++ b/app/vmagent/README.md @@ -277,6 +277,9 @@ It may be useful for performing `vmagent` rolling update without scrape loss. 'match[]': ['{__name__!=""}'] ``` + Note that `sample_limit` option doesn't work if stream parsing is enabled, since the pearsed data is pushed to remote storage as soon as it is parsed. So `sample_limit` option + has no sense during stream parsing. + * It is recommended to increase `-remoteWrite.queues` if `vmagent_remotewrite_pending_data_bytes` metric exported at `http://vmagent-host:8429/metrics` page constantly grows. * If you see gaps on the data pushed by `vmagent` to remote storage when `-remoteWrite.maxDiskUsagePerURL` is set, then try increasing `-remoteWrite.queues`. diff --git a/docs/vmagent.md b/docs/vmagent.md index 261c29f7a..6ea96dd1c 100644 --- a/docs/vmagent.md +++ b/docs/vmagent.md @@ -277,6 +277,9 @@ It may be useful for performing `vmagent` rolling update without scrape loss. 'match[]': ['{__name__!=""}'] ``` + Note that `sample_limit` option doesn't work if stream parsing is enabled, since the pearsed data is pushed to remote storage as soon as it is parsed. So `sample_limit` option + has no sense during stream parsing. + * It is recommended to increase `-remoteWrite.queues` if `vmagent_remotewrite_pending_data_bytes` metric exported at `http://vmagent-host:8429/metrics` page constantly grows. * If you see gaps on the data pushed by `vmagent` to remote storage when `-remoteWrite.maxDiskUsagePerURL` is set, then try increasing `-remoteWrite.queues`. diff --git a/docs/vmalert.md b/docs/vmalert.md index 4c93979c3..773873039 100644 --- a/docs/vmalert.md +++ b/docs/vmalert.md @@ -21,7 +21,6 @@ may fail; * by default, rules execution is sequential within one group, but persisting of execution results to remote storage is asynchronous. Hence, user shouldn't rely on recording rules chaining when result of previous recording rule is reused in next one; -* there is no `query` function support in templates yet; * `vmalert` has no UI, just an API for getting groups and rules statuses. ### QuickStart From b10ad446923b7c0399944f3e96295ff6453a49a3 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 15 Dec 2020 19:02:51 +0200 Subject: [PATCH 3/8] docs/vmagent.md: typo fix: pearsed->parsed --- app/vmagent/README.md | 2 +- docs/vmagent.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/vmagent/README.md b/app/vmagent/README.md index 6ea96dd1c..804168b9c 100644 --- a/app/vmagent/README.md +++ b/app/vmagent/README.md @@ -277,7 +277,7 @@ It may be useful for performing `vmagent` rolling update without scrape loss. 'match[]': ['{__name__!=""}'] ``` - Note that `sample_limit` option doesn't work if stream parsing is enabled, since the pearsed data is pushed to remote storage as soon as it is parsed. So `sample_limit` option + Note that `sample_limit` option doesn't work if stream parsing is enabled, since the parsed data is pushed to remote storage as soon as it is parsed. So `sample_limit` option has no sense during stream parsing. * It is recommended to increase `-remoteWrite.queues` if `vmagent_remotewrite_pending_data_bytes` metric exported at `http://vmagent-host:8429/metrics` page constantly grows. diff --git a/docs/vmagent.md b/docs/vmagent.md index 6ea96dd1c..804168b9c 100644 --- a/docs/vmagent.md +++ b/docs/vmagent.md @@ -277,7 +277,7 @@ It may be useful for performing `vmagent` rolling update without scrape loss. 'match[]': ['{__name__!=""}'] ``` - Note that `sample_limit` option doesn't work if stream parsing is enabled, since the pearsed data is pushed to remote storage as soon as it is parsed. So `sample_limit` option + Note that `sample_limit` option doesn't work if stream parsing is enabled, since the parsed data is pushed to remote storage as soon as it is parsed. So `sample_limit` option has no sense during stream parsing. * It is recommended to increase `-remoteWrite.queues` if `vmagent_remotewrite_pending_data_bytes` metric exported at `http://vmagent-host:8429/metrics` page constantly grows. From aa56b9217e13e0aa352ffe275e01c74b48f007e2 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 15 Dec 2020 20:39:12 +0200 Subject: [PATCH 4/8] app/vmagent: add `vmagent_remotewrite_blocks_sent_total` and `vmagent_remotewrite_bytes_sent_total` metrics per each `-remoteWrite.url` --- app/vmagent/remotewrite/client.go | 6 ++++++ docs/CHANGELOG.md | 2 ++ 2 files changed, 8 insertions(+) diff --git a/app/vmagent/remotewrite/client.go b/app/vmagent/remotewrite/client.go index 2ffdfab12..b5f693c8b 100644 --- a/app/vmagent/remotewrite/client.go +++ b/app/vmagent/remotewrite/client.go @@ -49,6 +49,8 @@ type client struct { fq *persistentqueue.FastQueue hc *http.Client + bytesSent *metrics.Counter + blocksSent *metrics.Counter requestDuration *metrics.Histogram requestsOKCount *metrics.Counter errorsCount *metrics.Counter @@ -111,6 +113,8 @@ func newClient(argIdx int, remoteWriteURL, sanitizedURL string, fq *persistentqu }, stopCh: make(chan struct{}), } + c.bytesSent = metrics.GetOrCreateCounter(fmt.Sprintf(`vmagent_remotewrite_bytes_sent_total{url=%q}`, c.sanitizedURL)) + c.blocksSent = metrics.GetOrCreateCounter(fmt.Sprintf(`vmagent_remotewrite_blocks_sent_total{url=%q}`, c.sanitizedURL)) c.requestDuration = metrics.GetOrCreateHistogram(fmt.Sprintf(`vmagent_remotewrite_duration_seconds{url=%q}`, c.sanitizedURL)) c.requestsOKCount = metrics.GetOrCreateCounter(fmt.Sprintf(`vmagent_remotewrite_requests_total{url=%q, status_code="2XX"}`, c.sanitizedURL)) c.errorsCount = metrics.GetOrCreateCounter(fmt.Sprintf(`vmagent_remotewrite_errors_total{url=%q}`, c.sanitizedURL)) @@ -187,6 +191,8 @@ func (c *client) runWorker() { func (c *client) sendBlock(block []byte) { retryDuration := time.Second retriesCount := 0 + c.bytesSent.Add(len(block)) + c.blocksSent.Inc() again: req, err := http.NewRequest("POST", c.remoteWriteURL, bytes.NewBuffer(block)) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index c3f9b63b4..3c556eab8 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,8 @@ # tip +* FEATURE: vmagent: export `vmagent_remotewrite_blocks_sent_total` and `vmagent_remotewrite_blocks_sent_total` metrics for each `-remoteWrite.url`. + # [v1.50.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.50.0) From a4c7fcb5e16d56fc72c5c821f839d7aabcc2c743 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 15 Dec 2020 20:56:16 +0200 Subject: [PATCH 5/8] lib/promscrape: properly remove deleted target from `/targets` page Previously `sw` variable wasn't captured correctly by the started goroutine. --- lib/promscrape/scraper.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/promscrape/scraper.go b/lib/promscrape/scraper.go index 0570f95e6..901b5a0fb 100644 --- a/lib/promscrape/scraper.go +++ b/lib/promscrape/scraper.go @@ -318,14 +318,14 @@ func (sg *scraperGroup) update(sws []*ScrapeWork) { sg.activeScrapers.Inc() sg.scrapersStarted.Inc() sg.wg.Add(1) - go func() { + tsmGlobal.Register(sw) + go func(sw *ScrapeWork) { defer sg.wg.Done() sc.sw.run(sc.stopCh) tsmGlobal.Unregister(sw) sg.activeScrapers.Dec() sg.scrapersStopped.Inc() - }() - tsmGlobal.Register(sw) + }(sw) sg.m[key] = sc additionsCount++ } From e8f645bf529d2c23c7ecfa3444907410899de69a Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 15 Dec 2020 21:06:01 +0200 Subject: [PATCH 6/8] docs/CHANGELOG.md: mention about bugfix, which properly removes unregistered targets from `/targets` page See bugfix at a4c7fcb5e16d56fc72c5c821f839d7aabcc2c743 --- docs/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 3c556eab8..d98f2aed8 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -4,6 +4,8 @@ * FEATURE: vmagent: export `vmagent_remotewrite_blocks_sent_total` and `vmagent_remotewrite_blocks_sent_total` metrics for each `-remoteWrite.url`. +* BUGFIX: vmagent: properly delete unregistered scrape targets from `/targets` and `/api/v1/targets` pages. They weren't deleted due to the bug in `v1.50.0`. + # [v1.50.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.50.0) From 4215182e61fce4e608b6dca6b97f4847dd9a17c8 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 15 Dec 2020 21:10:43 +0200 Subject: [PATCH 7/8] docs/Release-Guide.md: actualize release docs --- docs/Release-Guide.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/Release-Guide.md b/docs/Release-Guide.md index 24afb76ff..2c9674aa3 100644 --- a/docs/Release-Guide.md +++ b/docs/Release-Guide.md @@ -3,12 +3,12 @@ Release process guidance ## Release version and Docker images 0. Document all the changes for new release in [CHANGELOG.md](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/docs/CHANGELOG.md). -1. Create release tag with `git tag v1.xx.y`. +1. Create release tag with `git tag v1.xx.y` in `master` branch and `git tag v1.xx.y-cluster` in `cluster` branch. 2. Run `make release` for creating `*.tar.gz` release archive with the corresponding `_checksums.txt` inside `bin` directory. 3. Run `make publish` for creating and publishing Docker images. -4. Push release tag to https://github.com/VictoriaMetrics/VictoriaMetrics : `git push origin v1.xx.y`. -5. Go to https://github.com/VictoriaMetrics/VictoriaMetrics/releases , create new release from the pushed tag on step 4 - and upload `*.tar.gz` archive with the corresponding `_checksums.txt` from step 2. +4. Repeat steps 3-4 for `cluster` branch. +5. Push release tag to https://github.com/VictoriaMetrics/VictoriaMetrics : `git push origin v1.xx.y`. +6. Go to https://github.com/VictoriaMetrics/VictoriaMetrics/releases , create new release from the pushed tag on step 5 and upload `*.tar.gz` archive with the corresponding `_checksums.txt` from step 2. ## Helm Charts From 795e32be4a1988ed2dc34fb6875e04626fac2ba4 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 15 Dec 2020 21:11:39 +0200 Subject: [PATCH 8/8] docs/CHANGELOG.md: cut v1.50.1 release --- docs/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index d98f2aed8..7a8423f91 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,9 @@ # tip + +# [v1.50.1](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.50.1) + * FEATURE: vmagent: export `vmagent_remotewrite_blocks_sent_total` and `vmagent_remotewrite_blocks_sent_total` metrics for each `-remoteWrite.url`. * BUGFIX: vmagent: properly delete unregistered scrape targets from `/targets` and `/api/v1/targets` pages. They weren't deleted due to the bug in `v1.50.0`.