Should provisioned dashboards have datasource uids?

Grafana version: grafana:8.4.3-armv7

I’ve deployed a docker-compose file that contains Grafana, Prometheus, and node exporter combo and a provisioned dashboard. I am working on an update and I’ve made changes to the docker-compose file to use the latest Grafana, Prometheus, and replaced the provisioned dashboard with a new one.

I’d like users to be able to docker-compose down from their existing installation, pull my new docker-compose, and dashboard and docker-compose up.

The new JSON has some datasource UIDs present like below

"panels": [
      {
        "collapsed": false,
        "gridPos": {
          "h": 1,
          "w": 24,
          "x": 0,
          "y": 0
        },
        "id": 4,
        "panels": [],
        "title": "System Information",
        "type": "row"
      },
      {
        "datasource": {
          "type": "prometheus",
          "uid": "P1809F7CD0C75ACF3"
        },
        "fieldConfig": {
          "defaults": {
            "color": {
              "mode": "thresholds"
            },
            "mappings": [],
            "thresholds": {
              "mode": "absolute",
              "steps": [
                {
                  "color": "green",
                  "value": null
                }
              ]
            }
          },
          "overrides": []
        },
        "gridPos": {
          "h": 4,
          "w": 7,
          "x": 0,
          "y": 1
        },
        "id": 8,
        "options": {
          "colorMode": "value",
          "graphMode": "none",
          "justifyMode": "auto",
          "orientation": "auto",
          "reduceOptions": {
            "calcs": [
              "lastNotNull"
            ],
            "fields": "",
            "values": false
          },
          "textMode": "auto"
        },
        "pluginVersion": "8.4.3",
        "targets": [
          {
            "datasource": {
              "type": "prometheus",
              "uid": "P1809F7CD0C75ACF3"
            },
            "exemplar": true,
            "expr": "count(count(node_cpu_seconds_total{job=\"node_exporter\"}) by (cpu))",
            "interval": "",
            "legendFormat": "",
            "refId": "A"
          }
        ],
        "title": "CPU Cores",
        "type": "stat"
      },

Upon testing, when I do docker-compose restart, all the latest applications are pulled and dashboard gets updated but it has no data in it and I’m not entirely sure why. The Prometheus datasource is present in the dashboard, but all the queries/datasources for each panel are empty.

I’m trying to nail down the issue and my initial suspicion was maybe these Prometheus datasource UIDs might be causing no data being shown. What do these UIDs do exactly and should my provisioned dashboard have them?

(Note: if i delete the Grafana docker volume and start fresh, everything works fine. I’m wondering if this is the way to go for users that want to pull the latest changes…)