From 7da79a238f2333743ae58d4030786f378ef70387 Mon Sep 17 00:00:00 2001 From: Callum Styan Date: Tue, 17 Sep 2024 10:50:16 -0700 Subject: [PATCH] remove unnecessary change to how we check if series labels were present in local cache Signed-off-by: Callum Styan --- storage/remote/queue_manager.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/storage/remote/queue_manager.go b/storage/remote/queue_manager.go index a6f58660e..4189496d8 100644 --- a/storage/remote/queue_manager.go +++ b/storage/remote/queue_manager.go @@ -702,8 +702,8 @@ outer: continue } t.seriesMtx.Lock() - lbls := t.seriesLabels[s.Ref] - if lbls.Len() == 0 { + lbls, ok := t.seriesLabels[s.Ref] + if !ok { t.dataDropped.incr(1) if _, ok := t.droppedSeries[s.Ref]; !ok { level.Info(t.logger).Log("msg", "Dropped sample for series that was not explicitly dropped via relabelling", "ref", s.Ref) @@ -764,8 +764,8 @@ outer: continue } t.seriesMtx.Lock() - lbls := t.seriesLabels[e.Ref] - if lbls.Len() == 0 { + lbls, ok := t.seriesLabels[e.Ref] + if !ok { // Track dropped exemplars in the same EWMA for sharding calc. t.dataDropped.incr(1) if _, ok := t.droppedSeries[e.Ref]; !ok { @@ -821,8 +821,8 @@ outer: continue } t.seriesMtx.Lock() - lbls := t.seriesLabels[h.Ref] - if lbls.Len() == 0 { + lbls, ok := t.seriesLabels[h.Ref] + if !ok { t.dataDropped.incr(1) if _, ok := t.droppedSeries[h.Ref]; !ok { level.Info(t.logger).Log("msg", "Dropped histogram for series that was not explicitly dropped via relabelling", "ref", h.Ref) @@ -876,8 +876,8 @@ outer: continue } t.seriesMtx.Lock() - lbls := t.seriesLabels[h.Ref] - if lbls.Len() == 0 { + lbls, ok := t.seriesLabels[h.Ref] + if !ok { t.dataDropped.incr(1) if _, ok := t.droppedSeries[h.Ref]; !ok { level.Info(t.logger).Log("msg", "Dropped histogram for series that was not explicitly dropped via relabelling", "ref", h.Ref)