Replies: 5 comments 3 replies
-
Beta Was this translation helpful? Give feedback.
-
I wrote some hacky code to implement the ask above. One of the issues is that even if the UID is preserved, the ID has to be wiped out. There are two endpoints that are supported: The import endpoint: +++ b/test/data/org_1/dashboards/General/top-talkers-over-time.json
Since this might be valuable I'll change this to a conversation, but at this point, there is no pattern to fix this unless upstream changes. |
Beta Was this translation helpful? Give feedback.
-
Here's the hacky implementation, I yanked some of the code from testify for the JSON comparison. |
Beta Was this translation helpful? Give feedback.
-
As an option, if IDs in export files don't mean anything (id field is lost anyway on upload in current implementation), maybe you can provide an option to just fill them with some constants in export files? So export files won't change after every upload, because there will be |
Beta Was this translation helpful? Give feedback.
-
#211 Issue to track the requested behavior change. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
Now, on dashboards (or connections) upload, all dashboards/connections are just deleted in Grafana and then uploaded from scratch, thats's why their IDs are changed on every upload.
If we are keeping them in GIT, we are getting new changes on every download after upload.
So it becomes an infinite loop: we do upload -> ids changed in grafana, we do download -> ids changed in git -> we do upload, and so on..
Describe the solution you'd like
IDs of already existing resources in Grafana should be kept on upload.
If there is a way in grafana to specify IDs on resource creation - that's would be great.
If not, as a first approach you can match resources by UID and do PATCH instead of DELETE+PUT.
Describe alternatives you've considered
As an alternative, if IDs in export files don't mean anything as of now, maybe just fill them with some constants in export files? So export files won't change after every upload.
Beta Was this translation helpful? Give feedback.
All reactions