Skip to content

Commit f5ae015

Browse files
authored
fix(querier): show correct setting in error message (#14842)
If a query exceeds it's configured limit it returns an error message. This message currently references the (invalid) setting max_entries_limit, instead max_entries_limit_per_query should be used.
1 parent cfc3819 commit f5ae015

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

‎pkg/querier/http.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ func (q *QuerierAPI) validateMaxEntriesLimits(ctx context.Context, expr syntax.E
412412
maxEntriesLimit := util_validation.SmallestPositiveNonZeroIntPerTenant(tenantIDs, maxEntriesCapture)
413413
if int(limit) > maxEntriesLimit && maxEntriesLimit != 0 {
414414
return httpgrpc.Errorf(http.StatusBadRequest,
415-
"max entries limit per query exceeded, limit > max_entries_limit (%d > %d)", limit, maxEntriesLimit)
415+
"max entries limit per query exceeded, limit > max_entries_limit_per_query (%d > %d)", limit, maxEntriesLimit)
416416
}
417417
return nil
418418
}

‎pkg/querier/queryrange/limits.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939

4040
const (
4141
limitErrTmpl = "maximum of series (%d) reached for a single query"
42-
maxSeriesErrTmpl = "max entries limit per query exceeded, limit > max_entries_limit (%d > %d)"
42+
maxSeriesErrTmpl = "max entries limit per query exceeded, limit > max_entries_limit_per_query (%d > %d)"
4343
requiredLabelsErrTmpl = "stream selector is missing required matchers [%s], labels present in the query were [%s]"
4444
requiredNumberLabelsErrTmpl = "stream selector has less label matchers than required: (present: [%s], number_present: %d, required_number_label_matchers: %d)"
4545
limErrQueryTooManyBytesTmpl = "the query would read too many bytes (query: %s, limit: %s); consider adding more specific stream selectors or reduce the time range of the query"

‎pkg/querier/queryrange/roundtrip_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ func TestTripperware_EntriesLimit(t *testing.T) {
10381038
})
10391039

10401040
_, err = tpw.Wrap(h).Do(ctx, lreq)
1041-
require.Equal(t, httpgrpc.Errorf(http.StatusBadRequest, "max entries limit per query exceeded, limit > max_entries_limit (10000 > 5000)"), err)
1041+
require.Equal(t, httpgrpc.Errorf(http.StatusBadRequest, "max entries limit per query exceeded, limit > max_entries_limit_per_query (10000 > 5000)"), err)
10421042
require.False(t, called)
10431043
}
10441044

0 commit comments

Comments
 (0)