ysde / grafana-backup-tool

A Python-based application to backup Grafana settings by using the Grafana API
MIT License
877 stars 277 forks source link

add slug suffix for uid dashboards #222

Closed vindex10 closed 1 year ago

vindex10 commented 1 year ago

Hi! I suggest a flag to enable additional suffix for UID dashboards.

If the flag is disabled, like this UID_DASHBOARD_SLUG_SUFFIX=false (which is default and backwards compatible), the dashboard name is smth like aiofo1324hou2hr.dashboard.

when the flag is enabled UID_DASHBOARD_SLUG_SUFFIX=true, then the name also includes the slug: aiofo1324hou2hr-some-nice-name.dashboard

acjohnson commented 1 year ago

I'm not sure I understand the purpose of this change. What benefit is there in adding a custom suffix to the dashboard filenames?

vindex10 commented 1 year ago

Hi @acjohnson , thank you for attention!

Suffixes simplify the process of restoring one dashboard manually. Just makes it easier to navigate through the back up files.

Of course you pay with consistency after renaming, but then it is up to the user.

We would sacrifice consistency for easier navigation, for example.

acjohnson commented 1 year ago

Ah okay it actually gets the slug from the dashboard metadata. I tested it and since it defaults to off I think this is fine.