I am trying to import a dashboard which uses the “Mixed” datasource for most panels. Because we have multiple Grafana instances our automation will create the JSON with the correct datasources for each instance. I am having problems where the dashboard will import successfully but the datasources are all empty. We see errors such as "Datasource named was not found.
Backend data sources are Prometheus and our Grafana is v4.3.1. Both the templating and panels are not correctly registering the datasources. Here are some JSON snippets. I have confirmed data sources values match correctly.
I can upload our entire JSON but it is pretty large so I figured I would see if this was adequate. Please help.
"inputs": [
{
"name": "DS_W_NG1",
"pluginId": "prometheus",
"type": "datasource",
"value": "ds w ng1"
},
{
"name": "DS_C_NG1",
"pluginId": "prometheus",
"type": "datasource",
"value": "ds c ng1"
},
{
"name": "DS_P_NG1",
"pluginId": "prometheus",
"type": "datasource",
"value": "ds p ng1"
}
],
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "-- Mixed --",
"fill": 1,
"height": "350px",
"id": 9,
"legend": {
"alignAsTable": true,
"avg": true,
"current": true,
"max": true,
"min": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"span": 6,
"stack": false,
"steppedLine": false,
"targets": [
{
"datasource": "${DS_W_NG1}",
"expr": "java_lang_garbagecollector_collectioncount{pod=\"$pod\",package=\"$package\",name=\"ParNew\",location=~\"($location|all)\"}",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{instance}}",
"metric": "java_lang_garbagecollector_collectioncount",
"refId": "A",
"step": 4
},
"templating": {
"list": [
{
"allValue": null,
"current": {},
"datasource": "${DS_C_NG1}",
"hide": 0,
"includeAll": false,
"label": "Pod",
"multi": false,
"name": "pod",
"options": [],
"query": "label_values(pod)",
"refresh": 1,
"regex": "",
"sort": 1,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},