Skip to content
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

Limit series for metric queries. #2903

Merged
merged 12 commits into from
Nov 18, 2020
Merged

Conversation

cyriltovena
Copy link
Contributor

This adds a new limits: max series returned for metric queries. When a query exceed the maximum of series a 400 will be returned.

It will fail fast, on the first step of the engine (querier) evaluation or the first split of the query-frontend that cross the threshold.

Fixes #2823

Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
@codecov-io
Copy link

Codecov Report

Merging #2903 (0c7df78) into master (dfd2e20) will increase coverage by 0.15%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2903      +/-   ##
==========================================
+ Coverage   61.58%   61.74%   +0.15%     
==========================================
  Files         181      182       +1     
  Lines       14714    14759      +45     
==========================================
+ Hits         9062     9113      +51     
+ Misses       4824     4814      -10     
- Partials      828      832       +4     
Impacted Files Coverage Δ
pkg/logcli/query/query.go 35.59% <0.00%> (ø)
pkg/loki/modules.go 3.50% <0.00%> (ø)
pkg/querier/queryrange/roundtrip.go 70.14% <0.00%> (-0.68%) ⬇️
pkg/querier/queryrange/querysharding.go 44.31% <50.00%> (ø)
pkg/logql/engine.go 86.92% <60.00%> (-0.58%) ⬇️
pkg/logql/error.go 32.00% <80.00%> (-1.34%) ⬇️
pkg/querier/queryrange/limits.go 95.83% <92.85%> (-4.17%) ⬇️
pkg/logql/limits.go 100.00% <100.00%> (ø)
pkg/logql/parser.go 77.50% <100.00%> (ø)
pkg/logql/sharding.go 55.00% <100.00%> (+0.28%) ⬆️
... and 6 more

Copy link
Contributor

@achatterjee-grafana achatterjee-grafana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code will need dev review, few lines of doc look good to me.

@slim-bean slim-bean added this to the 2.2 milestone Nov 17, 2020
Copy link
Member

@owen-d owen-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few nits, lgtm

pkg/querier/queryrange/limits.go Show resolved Hide resolved
pkg/logql/error.go Show resolved Hide resolved
Copy link
Contributor

@achatterjee-grafana achatterjee-grafana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the

docs/sources/configuration/_index.md Outdated Show resolved Hide resolved
@cyriltovena cyriltovena merged commit 61ba02e into grafana:master Nov 18, 2020
cyriltovena pushed a commit to cyriltovena/loki that referenced this pull request Jun 11, 2021
…afana#2903)

* remove global metrics registry and util.Logger in cache package

Signed-off-by: Ben Ye <[email protected]>

* address comments and update changelog

Signed-off-by: Ben Ye <[email protected]>

* use util.Logger instead of noop logger

Signed-off-by: Ben Ye <[email protected]>

* use nil prometheus registry and address some nits

Signed-off-by: Ben Ye <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Limits metrics queries cardinality.
6 participants