Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grafana: avoid variable interpolation by escaping $

I have a query in Grafana for templating (against Influx) which has a tag which key contains the $ character.

How can I escape $ to avoid its interpolation with the variable?

Query:

SHOW TAG VALUES FROM "exdemon-analysis" WITH KEY = "analyzed_metric.attributes.$owner"

"analyzed_metric.attributes.$owner" is the key, $owner should not be replaced.

like image 406
DLanza Avatar asked Sep 01 '26 04:09

DLanza


1 Answers

The variable name was also $owner, which makes Grafana replace the $owner string in the field.

Plus, it seems I hit a bug in Influx. It does not like the combination of "." and measurement name with "special characters" in my case "-".

With the following query and not having var with name $owner the problem was solved:

SHOW TAG VALUES FROM "exdemon_analysis" WITH KEY = "analyzed_metric.attributes.$owner"
like image 178
DLanza Avatar answered Sep 04 '26 17:09

DLanza



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!