grafana-datasource icon indicating copy to clipboard operation
grafana-datasource copied to clipboard

Excessive escaping when using Grafana variables in queries

Open rul-hydro opened this issue 1 year ago • 1 comments

My dashboard has a variable with a regular expression to select different metrics.

If I use this variable in a query, special characters are escaped twice.

With a variable value of Regex=unit., the query {my_tag=~"${Regex}"} will be executed as {my_tag=~"unit\\."}, not returning any series instead of {my_tag=~"unit."}, which would return unit1, unit2 etc.

Grafana 11, Plugin 0.8.2, VictoriaMetrics 1.101.0

rul-hydro avatar Jun 04 '24 08:06 rul-hydro

Hello @rul-hydro ! Could you try repeating the test with Plugin 0.8.5? I've failed to reproduce it. Here's the steps I took:

  1. Created a variable below: image
  2. Created panel with VM datasource plugin and the following query: image
  3. Tried changing the variable options and observe state of the panel: image image
  4. Request params in Network panel seem correct as well image

hagen1778 avatar Aug 21 '24 11:08 hagen1778

Closing this ticket as stale. Feel free to rep-open if issue still remains.

hagen1778 avatar May 30 '25 14:05 hagen1778