From e3e40cb8484e0b28af784d7fe38584e4a7a6b23a Mon Sep 17 00:00:00 2001 From: Hui Wang Date: Mon, 3 Jun 2024 17:49:44 +0800 Subject: [PATCH] vmalert-tool: fix float values template in `input_series` (#6395) address https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6391 --------- Signed-off-by: hagen1778 Co-authored-by: hagen1778 --- app/vmalert-tool/unittest/input.go | 2 +- app/vmalert-tool/unittest/input_test.go | 4 ++-- docs/CHANGELOG.md | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/vmalert-tool/unittest/input.go b/app/vmalert-tool/unittest/input.go index c533164c2e..8d4582713c 100644 --- a/app/vmalert-tool/unittest/input.go +++ b/app/vmalert-tool/unittest/input.go @@ -18,7 +18,7 @@ import ( "github.com/VictoriaMetrics/metricsql" ) -var numReg = regexp.MustCompile(`\D?\d*\D?`) +var numReg = regexp.MustCompile(`\D?\d*\.?\d*\D?`) // series holds input_series defined in the test file type series struct { diff --git a/app/vmalert-tool/unittest/input_test.go b/app/vmalert-tool/unittest/input_test.go index 5f74de98b2..8ce90782d7 100644 --- a/app/vmalert-tool/unittest/input_test.go +++ b/app/vmalert-tool/unittest/input_test.go @@ -54,8 +54,8 @@ func TestParseInputValue(t *testing.T) { false, }, { - "1+1x4", - []sequenceValue{{Value: 1}, {Value: 2}, {Value: 3}, {Value: 4}, {Value: 5}}, + "1+1x2 0.1 0.1+0.3x2 3.14", + []sequenceValue{{Value: 1}, {Value: 2}, {Value: 3}, {Value: 0.1}, {Value: 0.1}, {Value: 0.4}, {Value: 0.7}, {Value: 3.14}}, false, }, { diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 5e71c9453f..9412660677 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -74,6 +74,7 @@ See also [LTS releases](https://docs.victoriametrics.com/lts-releases/). * BUGFIX: [vmauth](https://docs.victoriametrics.com/vmauth/): properly release memory used for metrics during config reload. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6247). * BUGFIX: [dashboards](https://grafana.com/orgs/victoriametrics): fix `AnnotationQueryRunner` error in Grafana when executing annotations query against Prometheus backend. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6309) for details. * BUGFIX: [Single-node VictoriaMetrics](https://docs.victoriametrics.com/) and `vmselect` in [VictoriaMetrics cluster](https://docs.victoriametrics.com/cluster-victoriametrics/): filter deleted label names and values from [`/api/v1/labels`](https://docs.victoriametrics.com/url-examples/#apiv1labels) and [`/api/v1/label/.../values`](https://docs.victoriametrics.com/url-examples/#apiv1labelvalues) responses when `match[]` filter matches small number of time series. The issue was introduced [v1.81.0](https://docs.victoriametrics.com/changelog_2022/#v1810). +* BUGFIX: [vmalert-tool](https://docs.victoriametrics.com/vmalert-tool/): fix float values template in `input_series`. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6391). * DEPRECATION: [vmagent](https://docs.victoriametrics.com/vmagent/): removed deprecated `-remoteWrite.multitenantURL` flag from vmagent. This flag was deprecated since [v1.96.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.96.0). Use `-enableMultitenantHandlers` instead, as it is easier to use and combine with [multitenant URL at vminsert](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#multitenancy-via-labels). See these [docs for details](https://docs.victoriametrics.com/vmagent.html#multitenancy).