prom_ex icon indicating copy to clipboard operation
prom_ex copied to clipboard

Make the folder UID part of the string that gets MD5'd to generate dashboard UID

Open sardaukar opened this issue 2 years ago • 1 comments

Change description

Make the folder UID part of the string that gets MD5'd to generate dashboard UID

What problem does this solve?

Issue number: https://github.com/akoutmos/prom_ex/issues/57

Example usage

Just use as normal, and if you have a codebase with 2 deployments environments uploading dashboards to GrafanaCloud, they won't overwrite each other.

Checklist

  • [ ] I have added unit tests to cover my changes.
  • [ ] I have added documentation to cover my changes.
  • [x] My changes have passed unit tests and have been tested E2E in an example project.

sardaukar avatar Apr 05 '22 12:04 sardaukar

Not sure if the change requires new documentation. As for the test, I can add one to explicitly reflect the "same dashboard, two folders" scenario.

sardaukar avatar Apr 05 '22 12:04 sardaukar

Tricky, wouldn't you want to have some Variable (Prod, Dev, Staging) instead of two different dashboards?

yordis avatar Apr 20 '23 04:04 yordis

I think this change makes the behaviour more predictable. Currently we can specify a folder name for Grafana dashboards:

:folder_name - The name of the folder that PromEx will put all of the project dashboards in. PromEx will automatically generate a unique ID for the folder based on the project's otp_app value so that it can access the correct folder in Grafana. This also makes sure that different Elixir projects running in the same cluster and publishing dashboards to Grafana do not collide with one another. If no name is provided, then the dashboards will all be uploaded to the default Grafana folder.

However, as it stands in practice Grafana dashboards are unique by name (and the folder is completely ignored for the purposes of uniqueness). As a result, having two PromEx installs differing by folder names results in a name collision in Grafana and the dashboards get shifted between folders.

jstr avatar Apr 25 '23 05:04 jstr