diff --git a/app/vmagent/remotewrite/pendingseries.go b/app/vmagent/remotewrite/pendingseries.go index 9d51ec653d..469c9d9447 100644 --- a/app/vmagent/remotewrite/pendingseries.go +++ b/app/vmagent/remotewrite/pendingseries.go @@ -150,13 +150,8 @@ func (wr *writeRequest) copyTimeSeries(dst, src *prompbmarshal.TimeSeries) { } dst.Labels = labelsDst[labelsLen:] - samplesDst = append(samplesDst, prompbmarshal.Sample{}) - dstSample := &samplesDst[len(samplesDst)-1] - if len(src.Samples) != 1 { - logger.Panicf("BUG: unexpected number of samples in time series; got %d; want 1", len(src.Samples)) - } - *dstSample = src.Samples[0] - dst.Samples = samplesDst[len(samplesDst)-1:] + samplesDst = append(samplesDst, src.Samples...) + dst.Samples = samplesDst[len(samplesDst)-len(src.Samples):] wr.samples = samplesDst wr.labels = labelsDst diff --git a/app/vmagent/remotewrite/remotewrite.go b/app/vmagent/remotewrite/remotewrite.go index a15308996c..c6390cc817 100644 --- a/app/vmagent/remotewrite/remotewrite.go +++ b/app/vmagent/remotewrite/remotewrite.go @@ -86,8 +86,6 @@ func Stop() { // Push sends wr to remote storage systems set via `-remoteWrite.url`. // -// Each timeseries in wr.Timeseries must contain one sample. -// // Note that wr may be modified by Push due to relabeling. func Push(wr *prompbmarshal.WriteRequest) { var rctx *relabelCtx