Skip to content

Commit 51d58c3

Browse files
committed
Bug fix: ingesters returning empty response
Signed-off-by: 🌲 Harry 🌊 John 🏔 <[email protected]>
1 parent c0e4545 commit 51d58c3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pkg/ingester/ingester.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2572,7 +2572,7 @@ func metadataQueryRange(queryStart, queryEnd int64, db *userTSDB, queryStoreForL
25722572
if queryIngestersWithin > 0 && queryStoreForLabels {
25732573
// If the feature for querying metadata from store-gateway is enabled,
25742574
// then we don't want to manipulate the mint and maxt.
2575-
return
2575+
return queryStart, queryEnd, nil
25762576
}
25772577

25782578
// Ingesters are run with limited retention and we don't support querying the store-gateway for labels yet.

pkg/ingester/ingester_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,14 +1797,16 @@ func Test_Ingester_MetricsForLabelMatchers(t *testing.T) {
17971797
},
17981798
},
17991799
"should filter metrics by time range if queryStoreForLabels and queryIngestersWithin is enabled": {
1800-
from: 100,
1801-
to: 1000,
1800+
from: 99999,
1801+
to: 100001,
18021802
matchers: []*client.LabelMatchers{{
18031803
Matchers: []*client.LabelMatcher{
18041804
{Type: client.EQUAL, Name: model.MetricNameLabel, Value: "test_1"},
18051805
},
18061806
}},
1807-
expected: []*cortexpb.Metric{},
1807+
expected: []*cortexpb.Metric{
1808+
{Labels: cortexpb.FromLabelsToLabelAdapters(fixtures[0].lbls)},
1809+
},
18081810
queryStoreForLabels: true,
18091811
queryIngestersWithin: time.Hour,
18101812
},

0 commit comments

Comments
 (0)