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++ nPendingSamples++
case tExemplar: case tExemplar:
l := make([]prompb.LabelRef, len(d.exemplarLabels)) // TODO(npazosmendez) optimize?
for i, el := range d.exemplarLabels { l := make([]prompb.LabelRef, 0, d.exemplarLabels.Len())
d.exemplarLabels.Range(func(el labels.Label) {
nRef := pool.intern(el.Name) nRef := pool.intern(el.Name)
vRef := pool.intern(el.Value) 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{ pendingData[nPending].Exemplars = append(pendingData[nPending].Exemplars, prompb.ExemplarRef{
Labels: l, Labels: l,
Value: d.value, Value: d.value,