Listen for changes to variable value in datasource

I would suggest learning about the EventBus and looking at the Grafana source code. We are using it in the panels, but it should be supported in the data sources as well.

Here are events related to the variables:

  • variables-changed
  • variables-changed-in-url
  • variables-time-range-process-done