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

[logql] don't try to execute a modified function that is not allowed by the AST #6346

Merged
merged 2 commits into from
Jun 9, 2022
Merged

[logql] don't try to execute a modified function that is not allowed by the AST #6346

merged 2 commits into from
Jun 9, 2022

Conversation

cstyan
Copy link
Contributor

@cstyan cstyan commented Jun 8, 2022

The original panic was not useful, the change to the clone function and it's usage will ensure that in future cases we at least get an error message along with the panic stack trace. This PR also calls the validate function on the modified range query to ensure it's still allowed. In the case of the panic we saw, unwrap is not allowed with count_over_time, when in the original query we had rate with unwrap which is allowed.

expr's validate) errors, instead of swallowing the error and then
attempting to execute a nil function, which panics anyways.

Signed-off-by: Callum Styan <callumstyan@gmail.com>
to execute it. If the validation fails we should return the original
expression.

Signed-off-by: Callum Styan <callumstyan@gmail.com>
@cstyan cstyan marked this pull request as ready for review June 8, 2022 21:34
@cstyan cstyan requested a review from a team as a code owner June 8, 2022 21:34
@grafanabot
Copy link
Collaborator

./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.5%
+               loki	0%

Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants