Skip to content

Commit 726ece2

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

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
@@ -13,7 +13,6 @@ import (
1313
"github.com/cortexproject/cortex/pkg/util/validation"
1414
"github.com/go-kit/kit/log/level"
1515
"github.com/prometheus/client_golang/prometheus"
16-
"github.com/prometheus/common/model"
1716
"github.com/prometheus/prometheus/tsdb"
1817
lbls "github.com/prometheus/prometheus/tsdb/labels"
1918
"github.com/thanos-io/thanos/pkg/block/metadata"
@@ -275,7 +274,7 @@ func (i *Ingester) v2MetricsForLabelMatchers(ctx old_ctx.Context, req *client.Me
275274
defer q.Close()
276275

277276
// Run a query for each matchers set and collect all the results
278-
added := model.FingerprintSet{}
277+
added := map[string]struct{}{}
279278
result := &client.MetricsForLabelMatchersResponse{
280279
Metric: make([]*client.Metric, 0),
281280
}
@@ -300,16 +299,16 @@ func (i *Ingester) v2MetricsForLabelMatchers(ctx old_ctx.Context, req *client.Me
300299
// return the unique set of matching series, we do check if the series has
301300
// already been added to the result
302301
ls := seriesSet.At().Labels()
303-
fp := client.Fingerprint(cortex_tsdb.FromLabelsToLegacyLabels(ls))
304-
if _, ok := added[fp]; ok {
302+
key := ls.String()
303+
if _, ok := added[key]; ok {
305304
continue
306305
}
307306

308307
result.Metric = append(result.Metric, &client.Metric{
309308
Labels: cortex_tsdb.FromLabelsToLabelAdapters(ls),
310309
})
311310

312-
added[fp] = struct{}{}
311+
added[key] = struct{}{}
313312
}
314313

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

0 commit comments

Comments
 (0)