Dear Community,
Hope you all are doing good.
Currently I am facing some strange issue. we are moving towards Dashboard as code with the help of grafanalib (python) and Terraform.
As a poc, I am replicating the existing dashboard to see the results of this move towards Dashboard as Code.
I am having a dashboard with three variables and these variables should pass-on towards targets of each panel.
for example:
template1 = Template(name="datasource", query='cloudwatch', default=None, dataSource=None,
label='Datasource', allValue=None, refresh=1, type='datasource', hide=0)
template2 = Template(name="region", query='regions()', default="eu-central-1", dataSource={
"uid": "$datasource"}, label='Region', allValue=None, refresh=1, type='query', hide=0)
template3 = Template(name="dbinstanceidentifier", query='dimension_values($region, AWS/RDS, CPUUtilization, DBInstanceIdentifier)',
default=None, dataSource={"uid": "$datasource"}, label='DBInstanceIdentifier', allValue=None, refresh=1, type='query', hide=0)
I have three panels, each of type Graph (old) with cloudwatchmetrics as a target to monitor different metrics like CPU utilisation, database connections, freeable mem, etc…
I see dashboard json is properly generated by the grafanalib and deployed properly by using Terraform in required Grafana folder.
When I open the dashboard I see all panels are empty/not showing any data until I click on edit each panel and then immediately click on apply.
I am not what could be the issue here, I see for every new deployment of Terraform changes these panels are getting the same and need to edit and apply again. I see this will be a blocker going forward if we add more and more panels and dashboards.
please share your exp, if any of you faced such situation already.