How to link to provisioned folders in a dashboard list panel

I’m trying to create a dashboard only consisting out of several dashboard list panels. Each of these panels should show dashboards from a specific folder.

All our dashboards and folders are created using file based provisioning (yaml files for folders and json files for dashboards). Everything lands in the right spot.

Thing is that, when creating the dashboard list, the selected folder translates to a folderID in json, to identify the folder to be used in a dashboard list panel. However, during provisioning, I can only define the folderUID, which cannot be used in the dashboard list to select the folder, it seems.

This basically means that when I use provisioning on an empty Grafana, all dashboards and folders are loaded properly, but the dashboard using the dashboard list, does not point to the right folder.

Did I miss something or did I bumped into an issue, in which case I’ll open up a GitHub ticket.

1 Like

I have the same question as OP.
I am bumping this thread as it was the first result on google.

Same issue, different explanation.

We use Ansible to deploy Grafana from scratch each time. When the instance starts, we

1.) created directories and dashboards using the Grafana provisioning architecture.

2.) update the “home” dashboard to contain dashboards list panels for each directory.

The problem is that the dashboard list is often blank.

The problem is a mismatch between dashboard list “folderId” value (fixed) and the dashboard database table “id” column (can change between deployments).

After looking into it, there is a collision of two issues:

  1. The Grafana provisioning inserts the records for the folders into the dashboard table in the Grafana database in an unpredictable order: the id’s auto-increment value for a given directory can change between deployments.
  2. The Dashboard List uses a fixed dashboard.id - the value when the dashboard was saved locally.

When there is a mismatch, the panel displays “blank.”

Can someone give me a pointer how to deploy provisioning directories and a dashboard list predicably?

If this can be “fixed,” I would suggest a few things:
1.) do a sort when adding folder into the dashboard table. sort “by is_folder desc, id”. Then folders are first and in a predictable order.
2.) the dashboard list could use dashboard.uid rather than the dashboard.id. Or, add another field to match on the folderUid if the folderId field is blank. If you go that route, it would be cleaner if the “folderUid” field in the dashboard.yaml provisioning file is required.