From 87910e4fa82ad45ea104344eb9085154aa9cee45 Mon Sep 17 00:00:00 2001 From: rusttech Date: Wed, 16 Oct 2024 16:35:17 +0800 Subject: [PATCH] app/vmctl: fixes opentsdb source metric tags Previously it was incorrectly used append for pre-allocated slice of labels. This commit fixes slice append by allocating zero length slice with needed capacity. --------- Co-authored-by: Nikolay --- app/vmctl/opentsdb.go | 2 +- docs/changelog/CHANGELOG.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/vmctl/opentsdb.go b/app/vmctl/opentsdb.go index 437da9e69..6ac4a6050 100644 --- a/app/vmctl/opentsdb.go +++ b/app/vmctl/opentsdb.go @@ -158,7 +158,7 @@ func (op *otsdbProcessor) do(s queryObj) error { if len(data.Timestamps) < 1 || len(data.Values) < 1 { return nil } - labels := make([]vm.LabelPair, len(data.Tags)) + labels := make([]vm.LabelPair, 0, len(data.Tags)) for k, v := range data.Tags { labels = append(labels, vm.LabelPair{Name: k, Value: v}) } diff --git a/docs/changelog/CHANGELOG.md b/docs/changelog/CHANGELOG.md index 5ed448300..1f615f532 100644 --- a/docs/changelog/CHANGELOG.md +++ b/docs/changelog/CHANGELOG.md @@ -18,6 +18,9 @@ See also [LTS releases](https://docs.victoriametrics.com/lts-releases/). ## tip + + + * FEATURE: add Darwin binaries for [VictoriaMetrics cluster](https://docs.victoriametrics.com/cluster-victoriametrics/) to the release flow. The binaries will be available in the new release. * FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent/): allow using HTTP/2 client for Kubernetes service discovery if `-promscrape.kubernetes.useHTTP2Client` cmd-line flag is set. This could help to reduce the amount of opened connections to the Kubernetes API server. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5971) for the details. * FEATURE: [vmalert](https://docs.victoriametrics.com/vmalert/): `-rule` cmd-line flag now supports multi-document YAML files. This could be useful when rules are retrieved via HTTP URL where multiple rule files were merged together in one response. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6753). Thanks to @Irene-123 for [the pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6995). @@ -28,6 +31,8 @@ See also [LTS releases](https://docs.victoriametrics.com/lts-releases/). * BUGFIX: [vmgateway](https://docs.victoriametrics.com/vmgateway/): fix possible panic during parsing of a token without `vm_access` claim. This issue was introduced in v1.104.0. * BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): fix error messages rendering from overflowing the screen with long messages. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/7207). +* BUGFIX: [vmctl](https://docs.victoriametrics.com/vmctl/): properly add metrics tags for `opentsdb` migration source. Previously it could have empty values. See [this PR](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/7161). + ## [v1.104.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.104.0)