-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Fix label extraction pushdown on instant queries #6215
Conversation
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0.1%
+ loki 0% |
1304c16
to
8c8bc11
Compare
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0.1%
+ loki 0% |
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. Thanks for catching this issue, great job!
// Downstream queries with label extractors can potentially produce a huge amount of series | ||
// which can impact the queries and consequently fail. | ||
// Note: vector aggregation expressions aggregate the result in a single empty label set, | ||
// so these expressions can be pushed downstream |
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.
👍
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.
looks great ;)
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
What this PR does / why we need it:
In the context of instant queries with label extractors logfmt & json, when combining range vector aggregators
bytes_over_time
,count_over_time
,rate
andbytes_rate
with vector aggregatorsmax
andmin
, it is not possible to usesum
as aggregation operator for downstream queries results. This results from the recent change to push downstream vector aggregator expressions: #6132List of failing tests: https://drone.grafana.net/grafana/loki/12011/2/5
This PR uses only
concat
as a downstream aggregation operator for expressions of the following types:Note: since
rate
andbytes_rate
range vector aggregator expressions are converted internally to a binary operation, these expressions return noop when inside amax
ormin
vector aggregator with a label extraction operator.Which issue(s) this PR fixes:
Special notes for your reviewer:
Checklist
CHANGELOG.md
.docs/sources/upgrading/_index.md