Skip to content

Commit

Permalink
Update pkg/distributor/distributor_test.go
Browse files Browse the repository at this point in the history
Co-authored-by: Arve Knudsen <[email protected]>
  • Loading branch information
santileira and aknuds1 authored Jan 21, 2025
1 parent 4127722 commit 61dcc6d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/distributor/distributor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6548,9 +6548,14 @@ loop:
for _, ts := range i.timeseries {
if match(ts.Labels, matchers) {
for _, lbl := range ts.Labels {
if _, ok := labelsSet[lbl.Name]; !ok {
labelsSet[lbl.Name] = struct{}{}
response.LabelNames = append(response.LabelNames, lbl.Name)
if _, ok := labelsSet[lbl.Name]; ok {
continue
}

labelsSet[lbl.Name] = struct{}{}
response.LabelNames = append(response.LabelNames, lbl.Name)
if hints != nil && hints.Limit > 0 && len(labelsSet) >= hints.Limit {
break loop
}
}
}
Expand Down

0 comments on commit 61dcc6d

Please sign in to comment.