Commit graph

4759 commits

Author SHA1 Message Date
Zakhar Bessarab
58e5238e63
lib/promrelabel: fix relabeling if clause (#4816)
* lib/promrelabel: fix relabeling if clause being applied to labels outside of current context

Relabeling is applied to each metric row separately, but in order to lower amount of memory allocations it is reusing labels.

Functions which are working on current metric row labels are supposed to use only current metric labels by using provided offset, but if clause matcher was using the whole labels set instead of local metrics.

This leaded to invalid relabeling results such as one described here: https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4806

Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com>

* docs/CHANGELOG.md: document the bugfix

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1998
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4806

---------

Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com>
Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
2023-08-12 08:38:04 -07:00
Aliaksandr Valialkin
f3849101f8
Upgrade Go builder from 1.20.4 to 1.21.0 2023-08-12 08:32:36 -07:00
Aliaksandr Valialkin
0e0ad21d30
deployment/docker/Makefile: upgrade base Docker image from alpine:3.18.2 to alpine:3.18.3
See https://alpinelinux.org/posts/Alpine-3.15.10-3.16.7-3.17.5-3.18.3-released.html
2023-08-12 08:25:38 -07:00
Roman Khavronenko
cc68b605a2
docs: mention fix for https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4221 (#4382)
https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4221

Signed-off-by: hagen1778 <roman@victoriametrics.com>

(cherry picked from commit 4b5faf7efb)
Signed-off-by: hagen1778 <roman@victoriametrics.com>
2023-06-05 11:28:01 +02:00
Roman Khavronenko
bf5b42c2dc
vmalert: do not return nil rules for /api/v1/rules (#4344)
The fix addresses a case when vmalert is configured with a group
which has `name`, but doesn't have `rules` configured. In this
case it still returns a `nil` instead of `[]` slice.

Fixing this via current commit.

See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4221

Signed-off-by: hagen1778 <roman@victoriametrics.com>
(cherry picked from commit 66ed6fe62f)
2023-06-05 11:28:00 +02:00
Roman Khavronenko
a14db3aace
vmalert: fix API to return non-nil values (#4222)
Properly return empty slices instead of nil for `/api/v1/rules` and `/api/v1/alerts` API handlers.
This improves compatibility with Grafana.

 https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4221

Signed-off-by: hagen1778 <roman@victoriametrics.com>

(cherry picked from commit 3383f12a4b)
Signed-off-by: hagen1778 <roman@victoriametrics.com>
2023-06-05 11:28:00 +02:00
Roman Khavronenko
2a7424a621
vmalert: fix nil map assignment (#4392)
The storage instance with nil map params was created for remote-read purposes.
And before change 7a9ae9de0d this map was ignored in ApplyParams.
Now, it started to be used and vmalert panics in runtime.

The fix properly inits map for at `NewVMStorage` and verifies it is not nil
on assignment in `ApplyParams`.

Signed-off-by: hagen1778 <roman@victoriametrics.com>

---------

Signed-off-by: hagen1778 <roman@victoriametrics.com>

(cherry picked from commit de94812088)
Signed-off-by: hagen1778 <roman@victoriametrics.com>
2023-06-05 11:28:00 +02:00
Roman Khavronenko
f7333d159c
app/vmalert: follow-up after 7a9ae9de0d (#4381)
7a9ae9de0d

Signed-off-by: hagen1778 <roman@victoriametrics.com>

(cherry picked from commit eccecdf177)
Signed-off-by: hagen1778 <roman@victoriametrics.com>
2023-06-05 11:27:59 +02:00
gsakun
a71f29e6eb
app/vmalert: fix datasource.roundDigits Parameter (#4341)
app/vmalert: fix querybuild clone and extraParams merge logic

See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4340

(cherry picked from commit 20dc3db71e)
Signed-off-by: hagen1778 <roman@victoriametrics.com>
2023-06-05 11:27:59 +02:00
Roman Khavronenko
ca405b0dae
vmalert: properly form assets address if httpPrefix set (#4351)
Properly form path to static assets in WEB UI
 if `http.pathPrefix` set.

 https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4349

Signed-off-by: hagen1778 <roman@victoriametrics.com>

(cherry picked from commit 51cea6cad4)
Signed-off-by: hagen1778 <roman@victoriametrics.com>
2023-06-05 11:27:59 +02:00
laixintao
d0c33a11c1
bugfix: fix vmalert navbar url. (#2949)
the doc url should not be joined by `prefix` because it's an abs url.

(cherry picked from commit 97abb601f2)
2023-06-05 11:27:58 +02:00
Aliaksandr Valialkin
7276d82b1d
vendor: make vendor-update 2023-05-18 18:02:53 -07:00
Aliaksandr Valialkin
0856f225cc
docs/CHANGELOG.md: cut v1.79.13 2023-05-18 17:56:51 -07:00
Aliaksandr Valialkin
529f01306a
deployment/docker/Makefile: use alpine 3.17.3 instead of alpine 3.18.0 for certs image, since alpine 3.18.0 doesnt work for cross-platform builds 2023-05-18 14:13:43 -07:00
Aliaksandr Valialkin
5cb5d91ba4
deployment/docker: update base docker image from 3.17.3 to 3.18.0
See https://www.alpinelinux.org/posts/Alpine-3.18.0-released.html
2023-05-12 17:34:27 -07:00
Aliaksandr Valialkin
aa591307ca
all: update Go builder from Go1.20.3 to Go1.20.4
See https://github.com/golang/go/issues?q=milestone%3AGo1.20.4+label%3ACherryPickApproved
2023-05-09 22:36:40 -07:00
Zakhar Bessarab
2ca92aaa34
lib/httpserver: add handler to serve /robots.txt and deny search indexing (#4143)
This handler will instruct search engines that indexing is not allowed for the content exposed to the internet. This should help to address issues like #4128 when instances are exposed to the internet without authentication.
2023-05-08 09:53:46 -07:00
Haleygo
1103f36c6e
fix sort pendingDateMetricsIDs (#4102) 2023-04-10 12:24:59 -07:00
Aliaksandr Valialkin
eef12514fa
docs/CHANGELOG.md: cut v1.79.12 2023-04-06 01:14:29 -07:00
Aliaksandr Valialkin
1c88a1a756
lib/encoding: fix test after 8af66ba156 2023-04-06 01:12:17 -07:00
Aliaksandr Valialkin
2570ee253d
vendor: make vendor-update 2023-04-05 21:47:27 -07:00
Aliaksandr Valialkin
ff505a6ec4
lib/encoding: fix test after 4725549cb2 2023-04-05 21:47:23 -07:00
Aliaksandr Valialkin
d95307ce4c
all: update Go builder from Go1.20.2 to Go1.20.3
See https://github.com/golang/go/issues?q=milestone%3AGo1.20.3+label%3ACherryPickApproved
2023-04-05 13:43:55 -07:00
Aliaksandr Valialkin
8ff2f1cc02
lib/promscrape: do not re-use previously loaded scrape targets on failed attempt to load updated scrape targets at file_sd_configs
The logic employed for re-using the previously loaded scrape target was broken initially.
The commit cc0427897c tried to fix it, but the new logic
became too complex and fragile. So it is better to just remove this logic,
since the targets from temporarily broken file should be eventually loaded on next
attempts every -promscrape.fileSDCheckInterval

This also allows removing fragile hacks around __vm_filepath label.

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3989
2023-04-02 21:18:43 -07:00
Dmytro Kozlov
4c5cc89007
lib/promscrape: fix the problem with scrape work duplicates when file_sd_config can't be read (#4027)
* lib/promscrape: fix the problem with scrape work duplicates when file_sd_config can't be read

* lib/promscrape: clarified comment

* lib/promscrape: made better approach to handle a problem with growing []*ScrapeWork on each error when loading config

* lib/promscrape: added CHANGELOG.md

* Update docs/CHANGELOG.md

---------

Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
2023-04-02 21:18:41 -07:00
Roman Khavronenko
05dfcc3947
lib/storage: check for free disk space before opening tables (#4035)
* lib/storage: check for free disk space before opening tables

We check for free disk space before call to `openTable`,
so `Storage` can be set to ReadOnly before mergeWorkers start.

Before the change, there was a chance that merges will start
even if Storage has to start in ReadOnly mode because of
`-storage.minFreeDiskSpaceBytes` limit.

https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4023
Signed-off-by: hagen1778 <roman@victoriametrics.com>

* lib/storage: chore

Signed-off-by: hagen1778 <roman@victoriametrics.com>

* Update lib/storage/storage.go

---------

Signed-off-by: hagen1778 <roman@victoriametrics.com>
Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
2023-04-01 00:33:53 -07:00
Aliaksandr Valialkin
d64858673d
deployment/docker: update base Docker image from Alpine 3.17.2 to Alpine 3.17.3
This fixes security issues from https://alpinelinux.org/posts/Alpine-3.17.3-released.html

This is a follow-up for 59c350d0d2
2023-03-31 22:51:12 -07:00
Max Golionko
dc912e83f2
fix: app/vmui/Dockerfile-web to reduce vulnerabilities (#4044)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-ALPINE317-OPENSSL-3368755
- https://snyk.io/vuln/SNYK-ALPINE317-OPENSSL-3368755
- https://snyk.io/vuln/SNYK-ALPINE317-OPENSSL-5291795
- https://snyk.io/vuln/SNYK-ALPINE317-OPENSSL-5291795

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-03-31 22:51:11 -07:00
Zakhar Bessarab
0e042a835e
lib/fs: verify response code when reading configuration over HTTP (#4036)
Verifying status code helps to avoid misleading errors caused by attempt to parse unsuccessful response.

Related issue: #4034

Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com>
2023-03-31 22:38:43 -07:00
Dmytro Kozlov
78f8e3a2c3
lib/storage: fix collect downsampling metrics (#489)
* lib/storage: fix downsampling

* lib/storage: update logic

* lib/storage: fix comments, removed unneeded check
2023-03-19 23:32:36 -07:00
Aliaksandr Valialkin
1ca79bae1a
docs/CHANGELOG.md: cut v1.79.11 2023-03-12 20:10:20 -07:00
Aliaksandr Valialkin
a55fad04c9
app/vmselect/promql: prevent from cannot unmarshal timeseries from rollupResultCache panic after the upgrade to v1.89.0
The issue has been introduced in 0af9e2b693
2023-03-12 19:11:30 -07:00
Aliaksandr Valialkin
108423c1a7
Makefile: fix golangci-lint version after bbe0baf67d 2023-03-12 17:14:40 -07:00
Aliaksandr Valialkin
1586ecc61a
Makefile: update golangci-lint from v1.51.1 to v1.51.2
See https://github.com/golangci/golangci-lint/releases/tag/v1.51.2
2023-03-12 17:09:46 -07:00
Aliaksandr Valialkin
29aa6a67da
app/vmselect/promql: updates tests for https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3664 2023-03-12 17:05:37 -07:00
Aliaksandr Valialkin
0ddde652e6
app/vmselect/promql: prevent from SIGBUS crash on architecures, which deny unaligned access to 8-byte words (e.g. ARM)
Thanks to @oliverpool for nailing down the root cause of the issue and for the initial attempt to fix it
at https://github.com/VictoriaMetrics/VictoriaMetrics/pull/3927
2023-03-12 17:02:46 -07:00
Aliaksandr Valialkin
e64e1ea849
vendor: make vendor-update 2023-03-12 03:05:33 -07:00
Aliaksandr Valialkin
12f4703e20
docs/CHANGELOG.md: document 113a89904d 2023-03-12 03:03:07 -07:00
Nikolay
80213232cc
lib/vmselectapi: fixes regression for disable compression setting (#3932)
after vmselect api refactoring it wasn't possible to disable response cache.
This patch restores correct behavior for rpc.disableCompression flag
2023-03-12 03:01:45 -07:00
Roman Khavronenko
bec42ac975
security: bump go version to 1.20.2 (#3935)
upgrade Go builder from Go1.20.1 to Go1.20.2
See the list of issues addressed in Go1.20.2 here (https://github.com/golang/go/issues?q=milestone%3AGo1.20.2+label%3ACherryPickApproved).

Signed-off-by: hagen1778 <roman@victoriametrics.com>
2023-03-12 01:42:35 -08:00
Aliaksandr Valialkin
9ddbc3727e
docs/CHANGELOG.md: document 927d9da270 2023-03-12 01:32:08 -08:00
Nikolay
5a8eacffcf
lib/storage: correctly handle io.EOF error for pre-fetched metrics (#3946)
io.EOF shouldn't be returned from this function. It breaks all search
API logic and may result in empty query results.
2023-03-12 01:29:34 -08:00
Aliaksandr Valialkin
8b50431c1a
docs/CHANGELOG.md: cut v1.79.10 2023-02-27 15:57:22 -08:00
Aliaksandr Valialkin
edfb7fa4d2
lib/storage: remove unused isFull field from hourMetricIDs struct 2023-02-27 15:51:07 -08:00
Aliaksandr Valialkin
ba92ea96da
docs/CHANGELOG.md: document the bugfix from 80e34e9c5d 2023-02-27 15:46:59 -08:00
Aliaksandr Valialkin
80e34e9c5d
lib/storage: fix TestUpdateCurrHourMetricIDs test when it runs on the first hour of the day by UTC 2023-02-27 15:41:57 -08:00
Aliaksandr Valialkin
32cdfec010
docs/CHANGELOG.md: add missing message about LTS release for v1.79.9 2023-02-24 15:08:02 -08:00
Aliaksandr Valialkin
ad2fcf3bb6
docs/CHANGELOG.md: cut v1.79.9 2023-02-24 13:57:02 -08:00
Aliaksandr Valialkin
6b84914dbf
vendor: make vendor-update 2023-02-24 13:53:51 -08:00
Aliaksandr Valialkin
419c16038d
vendor: make vendor-update 2023-02-18 23:05:36 -08:00