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)