Skip to content

Commit 09bd874

Browse files
committed
Make distributor queryable select on series hint
Signed-off-by: Goutham Veeramachaneni <[email protected]>
1 parent 44e0234 commit 09bd874

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pkg/querier/distributor_queryable.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ func (q *distributorQuerier) Select(_ bool, sp *storage.SelectHints, matchers ..
8484
// time range manipulation, otherwise we'll end up returning no series at all for
8585
// older time ranges (while in Cortex we do ignore the start/end and always return
8686
// series in ingesters).
87-
if sp == nil {
87+
// Also, in the recent versions of Prometheus, we pass in the hint but with Func set to "series".
88+
// See: https://github.com/prometheus/prometheus/pull/8050
89+
if sp == nil || sp.Func == "series" {
8890
ms, err := q.distributor.MetricsForLabelMatchers(ctx, model.Time(q.mint), model.Time(q.maxt), matchers...)
8991
if err != nil {
9092
return storage.ErrSeriesSet(err)

pkg/querier/querier.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ func (q querier) Select(_ bool, sp *storage.SelectHints, matchers ...*labels.Mat
275275
// Also, in the recent versions of Prometheus, we pass in the hint but with Func set to "series".
276276
// See: https://github.com/prometheus/prometheus/pull/8050
277277
if sp == nil || sp.Func == "series" {
278-
return q.metadataQuerier.Select(true, nil, matchers...)
278+
return q.metadataQuerier.Select(true, sp, matchers...)
279279
}
280280

281281
userID, err := user.ExtractOrgID(ctx)

0 commit comments

Comments
 (0)