fix minor lint issue + use labels Range function since it looks like

the tests fail to do `range labels.Labels` on CI

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-23 11:55:56 -08:00 committed by Nicolás Pazos
parent 18bf4b8c0e
commit 3e48b8a582
2 changed files with 2 additions and 4 deletions

View file

@ -26,7 +26,6 @@ import (
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/gogo/protobuf/proto"
"github.com/golang/snappy"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/model"
@ -1474,7 +1473,6 @@ func (s *shards) runShard(ctx context.Context, shardID int, queue *queue) {
s.sendMinLenSamples(ctx, pendingMinLenData[:n], symbolTable.LabelsData(), nPendingSamples, nPendingExemplars, nPendingHistograms, pBuf, &buf)
symbolTable.clear()
}
}
queue.ReturnForReuse(batch)
timer.Reset(time.Duration(s.qm.cfg.BatchSendDeadline))

View file

@ -1433,9 +1433,9 @@ func createDummyTimeSeries(instances int) []timeSeries {
b := labels.NewBuilder(commonLabels)
b.Set("pod", "prometheus-"+strconv.Itoa(i))
for _, lbls := range metrics {
for _, l := range lbls {
lbls.Range(func(l labels.Label) {
b.Set(l.Name, l.Value)
}
})
result = append(result, timeSeries{
seriesLabels: b.Labels(),
value: r.Float64(),