Prometheus Query value different when hard coded vs. dashboard variable

  • What Grafana version and what operating system are you using?
    v8.1.0

I have a Prometheus query where the labels is the metric version. I want to make this a dashboard variable. I have the variables loading and populating correctly. What’s not working is I’ve noticed that it’s not being translated correctly. When I hard code the value I want the query returns data, when I use the variable Grafana is doing some sort of URL escaping. This is a snippet of inspecting the query

Hard Coded Label Filter

What I write: metric_version="v0.1"
Query Inspection: metric_version%3D%22v0.1%22%7D

Variable Label Filter

What I write: metric_version="$metric_version"
Query Inspection metric_version%3D%22v0%5C%5C.1%22%7D

I’ve verified the value in the variable and I see that it’s like Grafana is URL encoding the variable value rather passing it a plain string.

@michaelblack can you screenshot your variable config? and what version grafana are you running?