Importing new dashboards #819
-
Hi: I need some help with the 'harvest grafana import' process. When I try to use 'import' to pull the new dashboard into Grafana, I get the following error: using API token from config Not understanding how import works. This appears to be saying that I can only import a dashboard which already exists in Grafana? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
hi @luddite516 we'll take a look at the error - in the interim, you should be able to import/export directly from the Grafana UI also. Can you try importing your exported Json file by clicking then and selecting the exported json file? |
Beta Was this translation helpful? Give feedback.
-
And can you paste the exact import and export commands you used so we can try to recreate? |
Beta Was this translation helpful? Give feedback.
-
Here is the export command from test/dev: bin/harvest grafana export --addr https://XXXXXXXXXX --https --token 'XXXXXXXXXXXXXXX' --folder 'Utility' --folder-7mode 'Utility' I run the above command on the prod server to connect to test/dev and pull its dashboards to prod. That command succeeds. Then, I run this command to try and pull the dashboards into Grafana on the prod server: bin/harvest grafana import --addr https://XXXXXXXXX --datasource "Prometheus via Thanos" --directory grafana/dashboards --https --token 'XXXXXXX' --folder 'Utility' --directory-cdot grafana/dashboards/Utility |
Beta Was this translation helpful? Give feedback.
-
Thanks for the details @luddite516, I understand the bug now. Harvest
but since the dashboards that you're trying to import have an Possible workarounds
We'll work on a fix for this, targeted for mid month |
Beta Was this translation helpful? Give feedback.
Thanks for the details @luddite516, I understand the bug now.
When exporting, Grafana also exports each dashboards's
id
Harvest
import
uses the Grafana create/update dashboard api to import the dashboards. That API saysbut since the dashboards that you're trying to import have an
id
, Grafana will try to update instead of create. The update is failing because the dashboard does not exist to update. Grafana returns the(404 - 404 Not Found) map[message:Dashboard not found status:not-found
Possible workarounds