From 3e48b8a5820c952528d0bb5b178892bac84958f6 Mon Sep 17 00:00:00 2001 From: Callum Styan Date: Thu, 23 Nov 2023 11:55:56 -0800 Subject: [PATCH] fix minor lint issue + use labels Range function since it looks like the tests fail to do `range labels.Labels` on CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Callum Styan Signed-off-by: Nicolás Pazos --- storage/remote/queue_manager.go | 2 -- storage/remote/queue_manager_test.go | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/storage/remote/queue_manager.go b/storage/remote/queue_manager.go index 560a0dc540..9ca4ebcbe7 100644 --- a/storage/remote/queue_manager.go +++ b/storage/remote/queue_manager.go @@ -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)) diff --git a/storage/remote/queue_manager_test.go b/storage/remote/queue_manager_test.go index a72c5c040d..55dcdff385 100644 --- a/storage/remote/queue_manager_test.go +++ b/storage/remote/queue_manager_test.go @@ -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(),