-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support subfolders while importing Grafana Dashboards #3412
Comments
hi @IvanZenger what version of Grafana are you using? It was only recently that Grafana added support for subfolders in Grafana 11. My read of Grafana's create folder API indicates that for subfolders to work in Grafana you need to enable the |
Hello @cgrinds, We are using Grafana version 11.2.3. The FeatureToggle The parentUid is not required when a dashboard is imported or created. It is only needed if a folder must be created. As in the first proposed solution, using the In the second solution, the implementation is quite open to interpretation. I would likely parse the path and recursively check if each folder exists. During this process, I would always know the folderUid of the parent folder, which allows me to use it as the parentUid for creating subfolders if they do not exist. |
Thanks @IvanZenger! We'll add this |
Great. If I can help somewhere, just let me know. Thanks a lot. |
Thanks to @IvanZenger for reporting Fixes: #3412
Very Cool @cgrinds, I tested it this morning, and it works as described. However, I have a observation: If I try to overwrite the dashboards, I receive a server response Command: Output:
If i change the Subfolder (example: "NetApp/Harvest 2.0") it works. The Folder "NetApp" is therefore not the problem. I guess the subfolder is not found and therefore it wants to create it. harvest/cmd/tools/grafana/grafana.go Lines 1221 to 1225 in 4832f74
|
Thanks to @IvanZenger for reporting Fixes: #3412
Thanks for the feedback @IvanZenger. You're correct, Grafana's Unrelated to this PR,
|
Do you know when this will be released? |
@IvanZenger These changes are available in the nightly build if you would like to try them out. They will also be included in the Harvest 25.02 release, scheduled for February. |
Verified in main at commit 4b2cbc0, Behaviour in Grafana 8.1.8,
One new folder Behaviour in Grafana 11.4.0,
![]() |
Is your feature request related to a problem? Please describe.
I would like to import the Grafana Harvest Dashboards into our Grafana instance under the folder
NetApp/Harvest
. However, when I use the command--serverfolder "NetApp/Harvest"
, it does not place the dashboards in the subfolder "Harvest" under "NetApp". Instead, it creates a new folder calledNetApp/Harvest
at the root level and imports the dashboards there.Describe the solution you'd like
Enhance the
grafana import
command with a--folderuid
flag that allows specifying the unique ID (UID) of the folder where the dashboards should be imported.Describe alternatives you've considered
Improve the
--serverfolder "NetApp/Harvest"
option to recognize and handle recursive paths correctly.The text was updated successfully, but these errors were encountered: