prom_ex
prom_ex copied to clipboard
Make the folder UID part of the string that gets MD5'd to generate dashboard UID
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.
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.
Tricky, wouldn't you want to have some Variable (Prod, Dev, Staging) instead of two different dashboards?
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.