Open yar2001 opened 1 year ago
Sorry for the delayed response. This appears to be related to the variable replacement syntax, which, normally will leave "variables" alone if no variable with that name is defined, but given that this happens in Javascript, everything has a toString. I don't have a good solution right now, and I've not had a whole lot of time to look into it.
Unfortunately, it seems that grafana doesn't support any sort of escaping: https://github.com/grafana/grafana/issues/40603 . I'll likely need to add an option to disable variable replacements for these cases.
As crazy as it sounds, you could try actually making a variable named "toString", and setting it to "$toString" and see if the replacement works.
After spending some time investigating, this appears to be a bug within Grafana itself. I've submitted a bug which github has so helpfully linked above this post. Once that is closed, this issue should be resolved. I'll leave this open until then in case there are further developments.
One admittedly rather unconventional workaround is to create a constant dollar=$ which is then prepended to toString
: ${dollar}toString
.
Source: https://community.grafana.com/t/escaping-a-dollar-sign-so-it-doesnt-get-treated-as-a-variable/67941/7
I encountered an error when using some aggregate like this. The error occurred in Grafana frontend before sending any query to the backend.
I’m using the
v0.2.0+rc3
version and everything else works great except for this issue. It seems that the problem is related to thetoString
keyword. Whenever the field name contains the wordtoString
, it will throw this error.