mullerpeter / databricks-grafana

Grafana Databricks integration allowing direct connection to Databricks to query and visualize Databricks data in Grafana.
Apache License 2.0
55 stars 4 forks source link

Switch over Databricks connections is not working properly, as well as setting Data Source as global variable #25

Closed lgurnik closed 1 year ago

lgurnik commented 1 year ago

Hello @mullerpeter , when i have tried to switch the data source (Both datasources are from Databricks with different connections) during dashboard creation, the retrieved data does not correspond the datasource was selected. As well i have tried to set the global variable with Data Source values, but it did not help.

However, if i will proceed to the current connections in Grafana and select there the needed one (which i wanted select during Dashboard creation) with "Save and Test" check, the needed data will be depicted in the dashboard from needed data source, but the switch between Data Sources on Dashboard level further does not work.

Do you have any idea?

Release version used: 1.1.4 Grafana version: 10.1.0 Grafana App deployed as Linux container using App Service in Azure.

In the request headers, property "x-datasource-uid" is different per Data Source on Dashboard level, based on the selected (for example DEV or PROD), but response data from "/api/ds/query?ds=mullerpeter-databricks-datasource" is the same one.

Maybe this is the grafana session issue, that only the connection change with "Test and Save" option will help to switch the datasource and have it really connected? I am not sure.

Thank you for the plugin, it helps me a lot. Thank you in advance for your answer!

mullerpeter commented 1 year ago

Hi @lgurnik

Thanks for raising the issue. This was in fact a bug in the Plugin itself. The databricks connection was not scoped to the datasource instance, but globally. Should be fixed in release 1.1.6.