grafana-client
grafana-client copied to clipboard
Need an API to export the dashboard that has enabled `autoMigrateOldPanels`
Describe the bug
Using Grafana v11.3.0 with feature flags enabled to auto-migrate the old Angular plugin to React autoMigrateOldPanels: true. However, when I try to export the dashboard using the tool, it always exports the old Angular version instead of the migrated React version that is stored in the database.
To Reproduce Steps to reproduce the behavior:
- Deploy Grafana v11.3.0 and enable
autoMigrateOldPanels: true. - Export the dashboard using the tool.
- The export doesn't include the migrated React dashboard but instead provides the old Angular version. However, the JSON model contains the React plugin changes, and the Share option displays the React-based dashboard.
Expected behavior Looking for a way to export the dashboard that was automatically migrated using the API.
Versions
- Grafana: [ 11.3.0]
grafana-client: [ 4.0]- Authentication: [Token]
Dear Mohan,
thanks a stack for writing in. Your request sounds reasonable. Are you able to provide a patch, or relay relevant pointers to Grafana HTTP API docs where corresponding information can be obtained how to retrieve the React version of dashboards?
In my humble naive world, I would not have expected that the JSON representation of dashboards change due to the migration from Angular to React. In this spirit, I am likewise happy to learn about it, and I am looking forward to provide optimal support through grafana-client.
With kind regards, Andreas.
There is some Golang code here, which is about detecting Angular vs. React, but I can't make any sense of it, in terms of figuring out how a dashboard representation differs between both variants, and/or how to retrieve them properly.
https://github.com/grafana/detect-angular-dashboards/blob/main/detector/detector.go https://github.com/grafana/detect-angular-dashboards/blob/main/api/grafana/grafana.go#L120-L134 https://github.com/grafana/detect-angular-dashboards/blob/main/output/output.go
Maybe it has been a bug with Grafana ~11.3, and has been fixed already, as Grafana 11.5.1 is available already? May we ask you to verify if the problem still prevails, @mohan-s-gopal?
Thanks for the update! I'll check if the issue persists in Grafana 11.5.1 and get back to you.
Gentle ping ;].
@amotl Thanks, it works!
Excellent, thanks for your response. Because we didn't do anything, we figure the problem got fixed with upstream Grafana. Let's close the issue.