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

[v10.1.x] Loki: Fix filters not being added with multiple expressions and parsers #75172

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

svennergr
Copy link
Contributor

Backport 480aa1c from #75152


What is this feature?

When using a dashboard with adhoc filters and a loki query containing two metric queries and label filters, the ad hoc filter is only added to the last label filter. Previously we determined the last positions of parsers or label filters in the whole query, however we need to do that per sub expression.

Which issue(s) does this PR fix?:

Fixes #75101

How do we reproduce it?

  1. Create a dashboard with a sum(rate({place="luna"} | logfmt [$__auto])) / sum(rate({place="moon"} |json [$__auto])) query.
  2. Add a Loki ad hoc filter.
  3. Apply the ad hoc filter and observe that it is only added to the last subexpression of a query.

…rs (#75152)

* determine last positions per expr

* fix lint

(cherry picked from commit 480aa1c)
@svennergr svennergr enabled auto-merge (squash) September 20, 2023 15:05
@svennergr svennergr merged commit 0b36718 into v10.1.x Sep 20, 2023
20 checks passed
@svennergr svennergr deleted the backport-75152-to-v10.1.x branch September 20, 2023 15:14
@github-actions
Copy link
Contributor

Backend code coverage report for PR #75172
No changes

@github-actions
Copy link
Contributor

Frontend code coverage report for PR #75172

Plugin Main PR Difference
loki 85.42% 85.31% -.11%

@aangelisc aangelisc modified the milestones: 10.1.x, 10.1.6 Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants