mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 16:30:55 +01:00
app/vmagent/remotewrite: allow ingesting time series with multiple samples at once
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/481
This commit is contained in:
parent
0f3d46810b
commit
1d71253653
@ -150,13 +150,8 @@ func (wr *writeRequest) copyTimeSeries(dst, src *prompbmarshal.TimeSeries) {
|
|||||||
}
|
}
|
||||||
dst.Labels = labelsDst[labelsLen:]
|
dst.Labels = labelsDst[labelsLen:]
|
||||||
|
|
||||||
samplesDst = append(samplesDst, prompbmarshal.Sample{})
|
samplesDst = append(samplesDst, src.Samples...)
|
||||||
dstSample := &samplesDst[len(samplesDst)-1]
|
dst.Samples = samplesDst[len(samplesDst)-len(src.Samples):]
|
||||||
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:]
|
|
||||||
|
|
||||||
wr.samples = samplesDst
|
wr.samples = samplesDst
|
||||||
wr.labels = labelsDst
|
wr.labels = labelsDst
|
||||||
|
@ -86,8 +86,6 @@ func Stop() {
|
|||||||
|
|
||||||
// Push sends wr to remote storage systems set via `-remoteWrite.url`.
|
// 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.
|
// Note that wr may be modified by Push due to relabeling.
|
||||||
func Push(wr *prompbmarshal.WriteRequest) {
|
func Push(wr *prompbmarshal.WriteRequest) {
|
||||||
var rctx *relabelCtx
|
var rctx *relabelCtx
|
||||||
|
Loading…
Reference in New Issue
Block a user