fix label ranging

Signed-off-by: Callum Styan <callumstyan@gmail.com>
Signed-off-by: Nicolás Pazos <npazosmendez@gmail.com>
This commit is contained in:
Callum Styan 2023-11-13 16:12:19 -08:00 committed by Nicolás Pazos
parent a9ca52d062
commit fbb81cbacc

View file

@ -1034,12 +1034,12 @@ func min64WriteRequestToWriteRequest(redReq *prompb.MinimizedWriteRequestFixed64
for i, rts := range redReq.Timeseries { for i, rts := range redReq.Timeseries {
lbls := Uint64RefToLabels(redReq.Symbols, rts.LabelSymbols) Uint64RefToLabels(redReq.Symbols, rts.LabelSymbols).Range(func(l labels.Label) {
ls := make([]prompb.Label, len(lbls)) req.Timeseries[i].Labels = append(req.Timeseries[i].Labels, prompb.Label{
for j, l := range lbls { Name: l.Name,
ls[j].Name = l.Name Value: l.Value,
ls[j].Value = l.Value })
} })
exemplars := make([]prompb.Exemplar, len(rts.Exemplars)) exemplars := make([]prompb.Exemplar, len(rts.Exemplars))
// TODO handle exemplars // TODO handle exemplars
@ -1054,7 +1054,6 @@ func min64WriteRequestToWriteRequest(redReq *prompb.MinimizedWriteRequestFixed64
// } // }
//} //}
req.Timeseries[i].Labels = ls
req.Timeseries[i].Samples = rts.Samples req.Timeseries[i].Samples = rts.Samples
req.Timeseries[i].Exemplars = exemplars req.Timeseries[i].Exemplars = exemplars
req.Timeseries[i].Histograms = rts.Histograms req.Timeseries[i].Histograms = rts.Histograms