diff --git a/app/vmagent/remotewrite/pendingseries.go b/app/vmagent/remotewrite/pendingseries.go index 31177a7fee..36a61bd1fd 100644 --- a/app/vmagent/remotewrite/pendingseries.go +++ b/app/vmagent/remotewrite/pendingseries.go @@ -126,9 +126,9 @@ func (wr *writeRequest) push(src []prompbmarshal.TimeSeries) { tssDst := wr.tss for i := range src { tssDst = append(tssDst, prompbmarshal.TimeSeries{}) - dst := &tssDst[len(tssDst)-1] - wr.copyTimeSeries(dst, &src[i]) - if len(wr.tss) >= maxRowsPerBlock { + wr.copyTimeSeries(&tssDst[len(tssDst)-1], &src[i]) + if len(tssDst) >= maxRowsPerBlock { + wr.tss = tssDst wr.flush() tssDst = wr.tss }