mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-02-09 15:27:11 +00:00
lib/promscrape: zero out labels after duplicate removal inside mergeLabels()
This commit is contained in:
parent
e9f08b1e6a
commit
1ae16bf671
1 changed files with 7 additions and 1 deletions
|
@ -1054,7 +1054,7 @@ func getLabelsContext() *labelsContext {
|
|||
}
|
||||
|
||||
func putLabelsContext(lctx *labelsContext) {
|
||||
labels := lctx.labels[:cap(lctx.labels)]
|
||||
labels := lctx.labels
|
||||
for i := range labels {
|
||||
labels[i].Name = ""
|
||||
labels[i].Value = ""
|
||||
|
@ -1317,6 +1317,12 @@ func mergeLabels(dst []prompbmarshal.Label, swc *scrapeWorkConfig, target string
|
|||
prevName = label.Name
|
||||
}
|
||||
}
|
||||
tail := dst[len(tmp):]
|
||||
for i := range tail {
|
||||
label := &tail[i]
|
||||
label.Name = ""
|
||||
label.Value = ""
|
||||
}
|
||||
return tmp
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue