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

Add instructions about how to force recreate Grafana dashboard after migrating to version 2.x #430

Closed demeringo closed 3 months ago

demeringo commented 5 months ago

Bug description

docker-compose does not automatically recreate grafana volume after migrating to cloud-scanner v2xxx.

As a consequence the Grafana provisioning does not occur. And new dashboard is not created. New metrics are likely not displayed.

To Reproduce

  1. Start a demo cloud-scanner stack of the v1.xx (deprecated) version
  2. Update your git repo to main branch (or any v2.xx version).
  3. Restart docker-compose.

Expected behavior

We should not force volume recreation, but give instruction and a warning in the Release note about what needs to be done.

Update documentation with roughly theses steps:

# List pre-existing volumes
docker volume list
DRIVER    VOLUME NAME
[....]
local     c17d45a051b92f33ffe84d9a6776a07bc14a134ec65ffaface937ce260fb8da2
local     cloud-scanner_grafana-data
local     e38e3ce9acb42360d2825872dfc1734dd3ec8aafeb5f2a814a7c7cdaae2818ad
local     e164ef3fe4a23c1cfb0e30d68c07a8b1a6d9a3f6ea5bcc9785f836d3d01ec8c9
[....]

Delete the cloud-scanner_grafana-data that was created in V1

# Try to delete the volume (fails because in use by a stopped container)
docker volume rm cloud-scanner_grafana-data
Error response from daemon: remove cloud-scanner_grafana-data: volume is in use - [8fe7b7461941b3094f713e3c86bf93a488eb04e64b6f997768830e1f7ab7dbd9]

# Delete the stopped container
docker-compose images
docker-compose images
    Container                   Repository                Tag       Image Id       Size
-----------------------------------------------------------------------------------------
boavizta_api        ghcr.io/boavizta/boaviztapi          1.2.2    36b10711fd68   427.6 MB
cloud_scanner_boa   ghcr.io/boavizta/cloud-scanner-cli   2.0.3    0cce38c8ebc9   41.32 MB
grafana_boa         grafana/grafana                      latest   a00c0638216f   399.1 MB
prometheus_boa      prom/prometheus                      latest   620d5e2a39df   247.2 MB

# delete Container grafana_boa
docker rm grafana_boa

# now delete volume
docker volume rm cloud-scanner_grafana-data
# Recreate compose stack
docker-compose up

JSON OUTPUT

Additional context

demeringo commented 5 months ago

@damienfernandes this is likely the reason why metrics are not displayed, I will need to update the doc.

demeringo commented 5 months ago

Sorry for making it confusing 😕, but after theses steps, you will see that grafana is now provisionned with 2 dashboards:

demeringo commented 3 months ago

This issue is more general, the same problem occurs when a new version of the dashboard is published (in any release).

We have 2 possibilities: