diff --git a/app/vmagent/remotewrite/remotewrite.go b/app/vmagent/remotewrite/remotewrite.go index ac5681aa4..b4f16ad3e 100644 --- a/app/vmagent/remotewrite/remotewrite.go +++ b/app/vmagent/remotewrite/remotewrite.go @@ -721,9 +721,10 @@ func dropAggregatedSeries(src []prompbmarshal.TimeSeries, matchIdxs []byte, drop func (rwctx *remoteWriteCtx) pushInternal(tss []prompbmarshal.TimeSeries) { if len(labelsGlobal) > 0 { rctx := getRelabelCtx() + defer putRelabelCtx(rctx) tss = rctx.appendExtraLabels(tss, labelsGlobal) - putRelabelCtx(rctx) } + pss := rwctx.pss idx := atomic.AddUint64(&rwctx.pssNextIdx, 1) % uint64(len(pss)) pss[idx].Push(tss)