-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support configurable maximum of the limits parameter #1798
Support configurable maximum of the limits parameter #1798
Conversation
52ac0ca
to
0f666de
Compare
812c003
to
b0731c2
Compare
This looks ready except for the zero case which I think you can quickly solve. Checking why the CI fails. EDIT: you have a test failing ! |
cda504c
to
f5d2508
Compare
@cyriltovena Have made all the changes. I see that currently we don't have complete testing for the |
Codecov Report
@@ Coverage Diff @@
## master #1798 +/- ##
==========================================
- Coverage 64.86% 64.69% -0.17%
==========================================
Files 122 122
Lines 9239 9271 +32
==========================================
+ Hits 5993 5998 +5
- Misses 2833 2856 +23
- Partials 413 417 +4
|
@@ -326,3 +337,17 @@ func writeError(err error, w http.ResponseWriter) { | |||
http.Error(w, err.Error(), http.StatusInternalServerError) | |||
} | |||
} | |||
|
|||
func (q *Querier) validateEntriesLimits(ctx context.Context, limit uint32) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to validate this also for LogQueryHandler
but only once we have verified it's a log request.
So after those lines:
// short circuit metric queries
if _, ok := expr.(logql.SampleExpr); ok {
writeError(httpgrpc.Errorf(http.StatusBadRequest, "legacy endpoints only support %s result type", logql.ValueTypeStreams), w)
return
}
f5d2508
to
5635f66
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
1274006
to
68c0218
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1798 +/- ##
==========================================
- Coverage 64.86% 64.69% -0.17%
==========================================
Files 122 122
Lines 9239 9271 +32
==========================================
+ Hits 5993 5998 +5
- Misses 2833 2856 +23
- Partials 413 417 +4
|
What this PR does / why we need it:
Support configurable maximum of the limits parameter
Which issue(s) this PR fixes:
Fixes #1795
Checklist