Automatic provisioning of Grafana dashboard (in docker compose stack) does not work anymore.
To Reproduce
use version v2.0.5
start docker compose
connect to grafana
access dashboard
Grafana complains that the dashboard cannot does not work due to a missing data source
First access to the provisionned dashboard display this pop up:
Templating
Failed to upgrade legacy queries
Editing a panel shows that the datasource is not set in the panel.
Datasource ${DS_CLOUD-SCANNER-PROMETHEUS} was not found
Expected behavior
The provisioned dashboard should point ot the provisioned datasource without manual action (no manual upload).
We should also provide a datasource agnostic dashboard to support the case where a user wants to point to a different datasource.
JSON OUTPUT
Additional context
If the demo dashboard is imported manually in grafana UI, we are prompted to select the data source, then the dashboard works fine.
It seems that the latest versions of the dashboard template were exported using the "export for external system" option which allow to variabilize the datasource (instead of using a hadcoded uid in the exported json). This is fine in case of manual import in Grafana but does not work well with automated provisioning.
Proposed implementation:
Fix the UID of cloud scanner prometheus data source in the datasource provisioning
Fix the UID of the datasource in the exported json dashboard (that will later be used to provision Grafana), using previous value.
Keep a datasource agnostic variant (exported with the Export for sharing externally option selected) of the demo dashboard, for the cases where we may want o import it through UI with a different datasource.
Bug description
Automatic provisioning of Grafana dashboard (in docker compose stack) does not work anymore.
To Reproduce
Grafana complains that the dashboard cannot does not work due to a missing data source
First access to the provisionned dashboard display this pop up:
Editing a panel shows that the datasource is not set in the panel.
Datasource ${DS_CLOUD-SCANNER-PROMETHEUS} was not found
Expected behavior
JSON OUTPUT
Additional context
If the demo dashboard is imported manually in grafana UI, we are prompted to select the data source, then the dashboard works fine.
It seems that the latest versions of the dashboard template were exported using the "export for external system" option which allow to variabilize the datasource (instead of using a hadcoded uid in the exported json). This is fine in case of manual import in Grafana but does not work well with automated provisioning.
Proposed implementation: