-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Limit series for metric queries. (#2903)
* Work in progress limit series. Signed-off-by: Cyril Tovena <[email protected]> * First draft of the series limiter. Signed-off-by: Cyril Tovena <[email protected]> * Add limiter to query-frontend. Signed-off-by: Cyril Tovena <[email protected]> * Add documentation. Signed-off-by: Cyril Tovena <[email protected]> * Fix build Signed-off-by: Cyril Tovena <[email protected]> * fmted Signed-off-by: Cyril Tovena <[email protected]> * lint and build fix Signed-off-by: Cyril Tovena <[email protected]> * Update docs/sources/configuration/_index.md Co-authored-by: achatterjee-grafana <[email protected]> * Review feedback. Signed-off-by: Cyril Tovena <[email protected]> * Reduce // for to fix flaky test. Signed-off-by: Cyril Tovena <[email protected]> Co-authored-by: achatterjee-grafana <[email protected]>
- Loading branch information
1 parent
901562e
commit 61ba02e
Showing
23 changed files
with
352 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package logql | ||
|
||
import ( | ||
"math" | ||
) | ||
|
||
var ( | ||
NoLimits = &fakeLimits{maxSeries: math.MaxInt32} | ||
) | ||
|
||
// Limits allow the engine to fetch limits for a given users. | ||
type Limits interface { | ||
MaxQuerySeries(userID string) int | ||
} | ||
|
||
type fakeLimits struct { | ||
maxSeries int | ||
} | ||
|
||
func (f fakeLimits) MaxQuerySeries(userID string) int { | ||
return f.maxSeries | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.