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

Multi-value dashboard variable value gets malformed in Loki query with equality operator #15151

Open
timtofan opened this issue Nov 27, 2024 · 1 comment

Comments

@timtofan
Copy link

timtofan commented Nov 27, 2024

Describe the bug
Multi-value dashboard variable value gets malformed in Loki query with equality operator.
More specifically, value a.b is inserted into query as a\\.b.

Issue only happens if "selection options: multi-value" or "selection options: all" is enabled.
I checked variable type "custom" and type "query to loki datasource with label values lookup", issue reproduces in both cases.
For simplicity, screenshots are using type custom.

To Reproduce

  • create dashboard variable, f.e. of type "custom" and set values as a.b,c.d, enable "selection options: multi-value"
  • create loki panel, use variable in label filter
  • click "inspect query" and check the variable value in the query

Expected behavior
Variable value is not malformed in the query, specifically should be a.b in used example.

Environment:
Tested both on Grafana Cloud 10 and Grafana Cloud 11, issue reproduces in both cases.
Datasource is to Loki OSS v3.1.

Screenshots
Image
Image
Image

@timtofan
Copy link
Author

A working fix is to use =~ instead of =.
But maybe some warning could be shown if = is not supported for multi-value variables?

@timtofan timtofan changed the title Dashboard variable value gets malformed in query to Loki Multi-value dashboard variable value gets malformed in Loki query with equality operator Nov 27, 2024
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

No branches or pull requests

1 participant