Boavizta / cloud-scanner

📡 Get Boavizta impact data for your aws cloud account usage.
GNU Affero General Public License v3.0
32 stars 7 forks source link

Automate dashboard provisioning with docker dompose demo stack #494

Closed demeringo closed 2 months ago

demeringo commented 2 months ago

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:

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

  1. The provisioned dashboard should point ot the provisioned datasource without manual action (no manual upload).
  2. 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: