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
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
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 …
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 › dashboards
Infinity plugin + JSON + dashboard variables - Dashboards - Grafana Labs Community Forums
September 21, 2024 - I’m running Grafana on a Linux OS The goal is to use a JSON to pass data to a variable. This variable will be used to modify (filter, visualisation name, timerange, …) a dynamic dashboard.
Grafana
community.grafana.com › t › how-to-update-a-dashboard-variable-from-html-plugin-with-javascript › 36222
How to update a dashboard variable from HTML plugin with javascript - Grafana Labs Community Forums
September 7, 2020 - Hello, I’m using the https://grafana.com/grafana/plugins/aidanmountford-html-panel plugin together with some lines of javascript code to configure a panel. Now, I want to update a dashboard variable. Could you provide …
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 - I am using Grafana 11.3 with the HTML Graphics plugin 2.1.1. I simply want to include the value of a dashboard constant variable in the HTML/SVG body. 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 ...