grafana / grafana/detect-angular-dashboards

Detector fails on folder dashboards and dashboards with missing data

Open
#67 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
32
Forks
4
Avg merge
11h 19m
Merged PRs (30d)
15

Description

**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:

1. **Folders are treated as dashboards**

* The current code calls `GetDashboard` on all entries, including folders, which causes **404 errors** for folders.

2. **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:**

1. Run the Angular Detector against a Grafana instance containing a mix of dashboards and folders.
2. Observe errors like:

```
get dashboard "dasdh1rcs5q8d": bad status code: 404
get dashboard "wjbtmtb": bad status code: 406
```
3. 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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.