From cc226e6ebeb34836709190b63313c29bbf601ca9 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 1 Jun 2022 14:51:26 +0300 Subject: [PATCH] docs/CHANGELOG.md: follow-up after 2177089f948494d462b6fca01df2bfd36c98e3c1 --- docs/CHANGELOG.md | 2 +- lib/promrelabel/relabel.go | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 7d717487a..21ab0626c 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -16,7 +16,7 @@ The following tip changes can be tested by building VictoriaMetrics components f ## tip * FEATURE: allow overriding default limits for in-memory cache `indexdb/tagFilters` via flag `-storage.cacheSizeIndexDBTagFilters`. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2663). -* FEATURE: add support of `lowercase` and `uppercase` relabeling actions for compatibility reasons. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2664). +* FEATURE: add support of `lowercase` and `uppercase` relabeling actions in the same way as [Prometheus 2.36.0 does](https://github.com/prometheus/prometheus/releases/tag/v2.36.0). See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2664). * FEATURE: support query tracing, which allows determining bottlenecks during query processing. See [these docs](https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#query-tracing) and [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1403). * FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): remove dependency on Internet access in `http://vmagent:8429/targets` page. Previously the page layout was broken without Internet access. See [shis issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2594). * FEATURE: [vmalert](https://docs.victoriametrics.com/vmalert.html): remove dependency on Internet access in [web API pages](https://docs.victoriametrics.com/vmalert.html#web). Previously the functionality and the layout of these pages was broken without Internet access. See [shis issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2594). diff --git a/lib/promrelabel/relabel.go b/lib/promrelabel/relabel.go index ccf2efc18..43ba650db 100644 --- a/lib/promrelabel/relabel.go +++ b/lib/promrelabel/relabel.go @@ -303,16 +303,18 @@ func (prc *parsedRelabelConfig) apply(labels []prompbmarshal.Label, labelsOffset case "uppercase": bb := relabelBufPool.Get() bb.B = concatLabelValues(bb.B[:0], src, prc.SourceLabels, prc.Separator) - value := strings.ToUpper(string(bb.B)) + valueStr := string(bb.B) relabelBufPool.Put(bb) - labels = setLabelValue(labels, labelsOffset, prc.TargetLabel, value) + valueStr = strings.ToUpper(valueStr) + labels = setLabelValue(labels, labelsOffset, prc.TargetLabel, valueStr) return labels case "lowercase": bb := relabelBufPool.Get() bb.B = concatLabelValues(bb.B[:0], src, prc.SourceLabels, prc.Separator) - value := strings.ToLower(string(bb.B)) + valueStr := string(bb.B) relabelBufPool.Put(bb) - labels = setLabelValue(labels, labelsOffset, prc.TargetLabel, value) + valueStr = strings.ToLower(valueStr) + labels = setLabelValue(labels, labelsOffset, prc.TargetLabel, valueStr) return labels default: logger.Panicf("BUG: unknown `action`: %q", prc.Action)