Skip to content

Commit 717493d

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

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* [BUGFIX] Fix panic when otel and xray tracing is enabled. #5044
2424
* [BUGFIX] Fixed no compact block got grouped in shuffle sharding grouper. #5055
2525
* [BUGFIX] Tracing: Fix missing object storage span instrumentation. #5074
26+
* [BUGFIX] Ingester: Ingesters returning empty response for metadata APIs. #5081
2627

2728
## 1.14.0 2022-12-02
2829

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)