Description:
While running the Angular Detector against a Grafana instance, I noticed that some dashboards fail to download, causing the run to terminate with errors. There appear to be two main issues:
-
Folders are treated as dashboards
- The current code calls
GetDashboard on all entries, including folders, which causes 404 errors for folders.
-
Dashboards with missing or empty data
- Some dashboards return 406 errors when calling
GetDashboard.
- This seems to happen for dashboards that exist but either have missing panels or are inaccessible via the API due to format, permissions, or missing content.
- These dashboards fail the run completely instead of being skipped or logged, making it hard to process large instances.
Steps to reproduce:
-
Run the Angular Detector against a Grafana instance containing a mix of dashboards and folders.
-
Observe errors like:
get dashboard "dasdh1rcs5q8d": bad status code: 404
get dashboard "wjbtmtb": bad status code: 406
-
Inspect dash.Type and note that 404 dashboards are actually folders.
Expected behavior:
- The detector should skip folders automatically.
- Dashboards with missing data or inaccessible via API should log a warning but not abort the entire run.
- Final output should include all successfully processed dashboards and a list of skipped/errored dashboards.
Suggested fix / possible approach:
- Check
dash.Type before calling GetDashboard and skip folders.
- Add more verbose logging for dashboards that return 406 errors (UID, URL, Type) to help identify the reason.
- Consider collecting download errors separately rather than aborting the entire run.
Environment:
- Grafana version: Grafana v12.3.1 (3a1c80ca7c)
- Detector commit: sha256:fff0c3435efe267bb4442493f4610d8de53f996008d92b735399ed320b8a1d6f
- Go version: go version go1.26.0 linux/amd64
Description:
While running the Angular Detector against a Grafana instance, I noticed that some dashboards fail to download, causing the run to terminate with errors. There appear to be two main issues:
Folders are treated as dashboards
GetDashboardon all entries, including folders, which causes 404 errors for folders.Dashboards with missing or empty data
GetDashboard.Steps to reproduce:
Run the Angular Detector against a Grafana instance containing a mix of dashboards and folders.
Observe errors like:
Inspect
dash.Typeand note that 404 dashboards are actually folders.Expected behavior:
Suggested fix / possible approach:
dash.Typebefore callingGetDashboardand skip folders.Environment: