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

Parser: Fix unwrap with duration label #7

Merged
merged 3 commits into from
May 26, 2022
Merged

Conversation

ivanahuckova
Copy link
Member

@ivanahuckova ivanahuckova commented May 26, 2022

Fixes: grafana/grafana#49401

This PR:

  1. In DurationFilter we need to use Identifier in the same way as it is used in https://github.com/grafana/loki/blob/main/pkg/logql/syntax/expr.y#L320
  2. In UnwrapExpr the grammar should be UnwrapExpr Pipe LabelFilter instead of Unwrap Pipe LabelFilter as in https://github.com/grafana/loki/blob/main/pkg/logql/syntax/expr.y#L179
  3. The conversion functions duration, duration_seconds and bytes are parsed only when used as functions.

I have also added and updated tests for these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loki: Metrics query with unwrap is not parsed correctly
2 participants