So for those looking for a solution / work around for this. This is what I ended up coming up with.
import { getDataSourceSrv } from '@grafana/runtime';
let templateSrv = (getDataSourceSrv() as any).templateSrv;
then to have my variables interpolated
templateSrv.replace(target.filter)
where filt… Answer from matthewbaker on community.grafana.com
Grafana
grafana.com › data source plugins › add support for variables
Add support for variables | Grafana Plugin Tools
Grafana saves the query model whenever one of the text fields loses focus (onBlur), and then it previews the values returned by metricFindQuery. The second argument to onChange allows you to set a text representation of the query that will appear next to the name of the variable in the variables list. Create a VariableSupport class that extends CustomVariableSupport: ... That's it! You can now try out the plugin by adding a query variable to your dashboard.
14:22
Variable Panel 2.3.1 for Grafana | New features and updates | Easy ...
10:34
Grafana dashboard variables on steroids | Variable panel with Single, ...
08:45
Synchronize dashboard variables with Data Manipulation in Grafana ...
01:00
Variable panel 1.5.0 for Grafana #grafana #variables #plugins ...
Grafana
community.grafana.com › grafana plugin development
Using Dashboard Variables in Query Editor - Grafana Plugin Development - Grafana Labs Community Forums
January 16, 2021 - Hi everyone, First of all, thank you so much for the hard work on Grafana, the platform is awesome. I’m using Grafana 7.3.6 and I’m building a datasource plugin with a backend. My plugin looks as follow: export const plugin = new DataSourcePlugin (DataSource) .setConfigEditor(ConfigEditor) .setQueryEditor(QueryEditor) .setVariableQueryEditor(VariablesEditor); What I’m trying to achieve is to use the dashboard variables in the query editor.
Grafana
community.grafana.com › grafana plugin development
What's the best way to access dashboard variables within a plugin? - Grafana Plugin Development - Grafana Labs Community Forums
August 21, 2017 - My dashboard has a couple of variables, what is the best way to expose the variable values within a plugin?
Grafana
grafana.com › variables
Variables | Grafana Scenes
Start with a variable definition. The following code creates a variable that retrieves all handler label values for the prometheus_http_requests_total metric from the Prometheus data source: ... The datasource used in the preceding code block refers to the core Grafana Prometheus data source plugin.
Grafana
community.grafana.com › t › include-variable-in-html-graphics-plugin › 135392
Include variable in HTML Graphics plugin - Grafana - Grafana Labs Community Forums
October 31, 2024 - Using ${VariableName} displayed as exactly that, ${VariableName} when I expect the value to be displayed. Below is an example from my test panel: " style="width: 100%; max-width: 400px; height: auto; display: block...
Grafana
community.grafana.com › grafana plugin development
Plugins, user input and variables - Grafana Plugin Development - Grafana Labs Community Forums
April 9, 2019 - Hi, I am developing a plugin, It makes extensive use of a free form text variable which can be frequently modified by the user. At the moment, I found no better way than implement this input field as a template variable. https://grafana.com/docs/reference/templating/ Question.1] Are there other ...
Grafana
community.grafana.com › grafana plugin development
Grafana panel plugin - simple editor - passing variables in input - Grafana Plugin Development - Grafana Labs Community Forums
August 3, 2021 - Hello, I have question about grafana panel plugin, becouse i am trying figure out, In simple editor I have some input fields, how can i pass variable for example “${_dasboard}” ? Becouse Grafana doesnt interprete this…
Timesofcloud
timesofcloud.com › home › prometheus grafana
Prometheus & Grafana — Variables & Templates -
March 30, 2026 - # Filter by selected instance ...ds_total{instance=~"$instance", mode="idle"}[5m]) # Chained variables kube_pod_info{namespace="$namespace", pod="$pod"}...
Grafana
community.grafana.com › grafana plugin development
How to change a dashboard variable value from a plugin? - Grafana Plugin Development - Grafana Labs Community Forums
August 31, 2018 - Hello- What is the best way for a panel plugin to update a variable? I have tried: this.$location.search( 'var-'+name, value ); This updates the URL properly, and on browser refresh, the variables is set, but I wou…
Grafana
grafana.com › docs › grafana › latest › dashboards › variables › add-template-variables
Add variables | Grafana documentation
The typical implementation uses every string value returned from the data source response as a variable value. Make sure to double-check the documentation for the data source. Some data sources let you provide custom “display names” for the values. For instance, the PostgreSQL, MySQL, and Microsoft SQL Server plugins handle this by looking for fields named __text and __value in the result.
Grafana
community.grafana.com › grafana plugin development
How to listen for when a variable changes? - Grafana Plugin Development - Grafana Labs Community Forums
November 17, 2021 - Hello, How Can I listen on grafana variables change from my custom plugin code that is implemented in react ? I need to update my custom panel according to a variable changes. I didn’t find any documentation regarding …