fix build

Signed-off-by: Nicolás Pazos <npazosmendez@gmail.com>
This commit is contained in:
Nicolás Pazos 2023-10-06 16:57:49 -03:00
parent e70780ca86
commit 9b4fbd9552

View file

@ -1625,12 +1625,13 @@ func (s *shards) populateReducedTimeSeries(pool *lookupPool, batch []timeSeries,
})
nPendingSamples++
case tExemplar:
l := make([]prompb.LabelRef, len(d.exemplarLabels))
for i, el := range d.exemplarLabels {
// TODO(npazosmendez) optimize?
l := make([]prompb.LabelRef, 0, d.exemplarLabels.Len())
d.exemplarLabels.Range(func(el labels.Label) {
nRef := pool.intern(el.Name)
vRef := pool.intern(el.Value)
l[i] = prompb.LabelRef{NameRef: nRef, ValueRef: vRef}
}
l = append(l, prompb.LabelRef{NameRef: nRef, ValueRef: vRef})
})
pendingData[nPending].Exemplars = append(pendingData[nPending].Exemplars, prompb.ExemplarRef{
Labels: l,
Value: d.value,