fix labels usage
Some checks are pending
CI / Go tests (push) Waiting to run
CI / More Go tests (push) Waiting to run
CI / Go tests with previous Go version (push) Waiting to run
CI / UI tests (push) Waiting to run
CI / Go tests on Windows (push) Waiting to run
CI / Mixins tests (push) Waiting to run
CI / Build Prometheus for common architectures (0) (push) Waiting to run
CI / Build Prometheus for common architectures (1) (push) Waiting to run
CI / Build Prometheus for common architectures (2) (push) Waiting to run
CI / Build Prometheus for all architectures (0) (push) Waiting to run
CI / Build Prometheus for all architectures (1) (push) Waiting to run
CI / Build Prometheus for all architectures (10) (push) Waiting to run
CI / Build Prometheus for all architectures (11) (push) Waiting to run
CI / Build Prometheus for all architectures (2) (push) Waiting to run
CI / Build Prometheus for all architectures (3) (push) Waiting to run
CI / Build Prometheus for all architectures (4) (push) Waiting to run
CI / Build Prometheus for all architectures (5) (push) Waiting to run
CI / Build Prometheus for all architectures (6) (push) Waiting to run
CI / Build Prometheus for all architectures (7) (push) Waiting to run
CI / Build Prometheus for all architectures (8) (push) Waiting to run
CI / Build Prometheus for all architectures (9) (push) Waiting to run
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions
CI / Check generated parser (push) Waiting to run
CI / golangci-lint (push) Waiting to run
CI / fuzzing (push) Waiting to run
CI / codeql (push) Waiting to run
CI / Publish main branch artifacts (push) Blocked by required conditions
CI / Publish release artefacts (push) Blocked by required conditions
CI / Publish UI on npm Registry (push) Blocked by required conditions

Signed-off-by: Callum Styan <callumstyan@gmail.com>
This commit is contained in:
Callum Styan 2024-08-27 21:43:06 -07:00
parent e7a69ec50f
commit 696c3c0a3c
2 changed files with 10 additions and 10 deletions

View file

@ -102,8 +102,8 @@ func (p *pool) intern(ref chunks.HeadSeriesRef, lset labels.Labels) labels.Label
return interned.lset
}
if len(lset) == 0 {
return nil
if lset.Len() == 0 {
return labels.EmptyLabels()
}
p.pool[ref] = newEntry(lset)

View file

@ -704,11 +704,11 @@ outer:
t.seriesMtx.Lock()
var lbls labels.Labels
if t.interner.shouldIntern {
lbls = t.interner.intern(s.Ref, nil)
lbls = t.interner.intern(s.Ref, labels.EmptyLabels())
} else {
lbls = t.seriesLabels[s.Ref]
}
if len(lbls) == 0 {
if lbls.Len() == 0 {
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)
@ -771,11 +771,11 @@ outer:
t.seriesMtx.Lock()
var lbls labels.Labels
if t.interner.shouldIntern {
lbls = t.interner.intern(e.Ref, nil)
lbls = t.interner.intern(e.Ref, labels.EmptyLabels())
} else {
lbls = t.seriesLabels[e.Ref]
}
if len(lbls) == 0 {
if lbls.Len() == 0 {
// Track dropped exemplars in the same EWMA for sharding calc.
t.dataDropped.incr(1)
if _, ok := t.droppedSeries[e.Ref]; !ok {
@ -833,11 +833,11 @@ outer:
t.seriesMtx.Lock()
var lbls labels.Labels
if t.interner.shouldIntern {
lbls = t.interner.intern(h.Ref, nil)
lbls = t.interner.intern(h.Ref, labels.EmptyLabels())
} else {
lbls = t.seriesLabels[h.Ref]
}
if len(lbls) == 0 {
if lbls.Len() == 0 {
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)
@ -893,11 +893,11 @@ outer:
t.seriesMtx.Lock()
var lbls labels.Labels
if t.interner.shouldIntern {
lbls = t.interner.intern(h.Ref, nil)
lbls = t.interner.intern(h.Ref, labels.EmptyLabels())
} else {
lbls = t.seriesLabels[h.Ref]
}
if len(lbls) == 0 {
if lbls.Len() == 0 {
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)