0

Problem: When generating dashboard panels using Python Requests, unless the panel query is manually clicked ‘Run’ on Grafana UI, there is no data displayed.

Attached image shows how it does not display any panel dataenter image description here

Steps To Reproduce: Once the python code generates the panels, i click on edit panel --> re select the drop down options for the query and click run

Details: The dashboard setting is set to refresh continuously. However only when i manually select the dropdown for region, data source, database etc, does the query work and display data. My data source is athena and it is set as default

I have only 1 data source that is set as the default. What causes this behavior and how do i fix it?

Code :"targets": [ { "connectionArgs": { "catalog": "__default", "database": "db_name", "region": "__default" }, "datasource": { "type": "grafana-athena-datasource", "uid": "i3443ih4k" }, "format": 1, "rawSQL": athena_query, "refId": "A", "table": table_name } Please see images below

1st snapshot, generated by code 2nd snapshot when i manually select for dropdownenter image description here

  • Why do you expect that query will be executed automatically? Especially, when you are paying per query in the Athena case. I would say that's safe behaviour from the Grafana developers. – Jan Garaj Jan 31 '23 at 21:48
  • @JanGaraj Thanks for the quick response. That i think about it now, it totally makes sense. I have previously used mysql data sources where the query would be automatically run. The issue here however is that with the panel being generated programmatically, even if i were to manually run the query it does not work. It only works if i re-select each drop down to the same value it was configured to and then be able to run. Not sure if this is something i could control via code. there seems to be a refresh option for the dashboard. But that isnt helpful either – Starseamoon Jan 31 '23 at 21:50

0 Answers0