app/vmagent: properly add labels set via -remoteWrite.label to metrics before sending them to -remoteWrite.url

This commit is contained in:
Aliaksandr Valialkin 2020-03-06 19:26:17 +02:00
parent 58a3e59d59
commit c386c5de57

View file

@ -89,7 +89,7 @@ func Stop() {
// Each timeseries in wr.Timeseries must contain one sample. // Each timeseries in wr.Timeseries must contain one sample.
func Push(wr *prompbmarshal.WriteRequest) { func Push(wr *prompbmarshal.WriteRequest) {
var rctx *relabelCtx var rctx *relabelCtx
if len(prcsGlobal) > 0 { if len(prcsGlobal) > 0 || len(labelsGlobal) > 0 {
rctx = getRelabelCtx() rctx = getRelabelCtx()
} }
tss := wr.Timeseries tss := wr.Timeseries