Skip to content

Commit e1969c5

Browse files
committed
Do not use any hashing to uniquely identify a series in v2MetricsForLabelMatchers()
Signed-off-by: Marco Pracucci <[email protected]>
1 parent 0c25302 commit e1969c5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pkg/ingester/ingester_v2.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"github.com/cortexproject/cortex/pkg/util/validation"
1313
"github.com/go-kit/kit/log/level"
1414
"github.com/prometheus/client_golang/prometheus"
15-
"github.com/prometheus/common/model"
1615
"github.com/prometheus/prometheus/tsdb"
1716
lbls "github.com/prometheus/prometheus/tsdb/labels"
1817
"github.com/thanos-io/thanos/pkg/block/metadata"
@@ -243,7 +242,7 @@ func (i *Ingester) v2MetricsForLabelMatchers(ctx old_ctx.Context, req *client.Me
243242
defer q.Close()
244243

245244
// Run a query for each matchers set and collect all the results
246-
added := model.FingerprintSet{}
245+
added := map[string]struct{}{}
247246
result := &client.MetricsForLabelMatchersResponse{
248247
Metric: make([]*client.Metric, 0),
249248
}
@@ -268,16 +267,16 @@ func (i *Ingester) v2MetricsForLabelMatchers(ctx old_ctx.Context, req *client.Me
268267
// return the unique set of matching series, we do check if the series has
269268
// already been added to the result
270269
ls := seriesSet.At().Labels()
271-
fp := client.Fingerprint(cortex_tsdb.FromLabelsToLegacyLabels(ls))
272-
if _, ok := added[fp]; ok {
270+
key := ls.String()
271+
if _, ok := added[key]; ok {
273272
continue
274273
}
275274

276275
result.Metric = append(result.Metric, &client.Metric{
277276
Labels: cortex_tsdb.FromLabelsToLabelAdapters(ls),
278277
})
279278

280-
added[fp] = struct{}{}
279+
added[key] = struct{}{}
281280
}
282281

283282
// In case of any error while iterating the series, we break

0 commit comments

Comments
 (0)