esnet / gdg

Grafana Dashboard Manager
https://software.es.net/gdg/
Other
343 stars 32 forks source link

Newer Grafana dashboards can't find datasources #71

Closed arlake228 closed 2 years ago

arlake228 commented 2 years ago

It looks like sometime around 8.3.6 (first time I noticed it), Grafana changed the way the dashboards refer to a datasource. It now refers to them by uid instead of by name. The problem with this is that the uid seems to change across deployments meaning when you export the dashboards it can't find any of the data sources. You can see this by running gdg dash import against a Grafana instance running 8.3.6 then running gdg dash export.

Specifically, when you'd gdg dash import with previous Grafana versions, the data sources in the dashboard json looks something like following:

{
      "datasource": "Flow - Rollup by Edge ASNs (5m)",
      ...
}

With 8.3.6 it looks like the following:

{
      "datasource": {
        "type": "elasticsearch",
        "uid": "VuEGTpa7k"
      }
      ...
}
safaci2000 commented 2 years ago

Hmm, I can't seem to reproduce the same behavior @arlake228.

I updated to 8.3.6 in docker. Imported all DS and dashboards and pulling all of them back out, I'm seeing.

        "datasource": "-- Grafana --",
         "datasource": null,
               "datasource": "Netsage TSDS"

Even confirmed the Server info it's connecting to:

dg server  info
time="2022-02-17T08:14:00-06:00" level=info msg="Database:  ok"
time="2022-02-17T08:14:00-06:00" level=info msg="Commit:  bf8766bbf2"
time="2022-02-17T08:14:00-06:00" level=info msg="Version:  8.3.6"
safaci2000 commented 2 years ago

Blocked on: https://github.com/grafana-tools/sdk/pull/195. Disregard previous comment. It seems like the UI interaction creates this behavior. Using just the API won't change the JSON.