From c1c48c62e95f583130da5d30385eb57432ff3096 Mon Sep 17 00:00:00 2001 From: Orsiris de Jong Date: Wed, 28 Dec 2022 19:44:32 +0100 Subject: [PATCH] Make dashboard portable Allows to select datasource when first importing into grafana --- .../dashboards/rest-server.json | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/examples/compose-with-grafana/dashboards/rest-server.json b/examples/compose-with-grafana/dashboards/rest-server.json index e3c9e8d..6db6163 100644 --- a/examples/compose-with-grafana/dashboards/rest-server.json +++ b/examples/compose-with-grafana/dashboards/rest-server.json @@ -1,4 +1,14 @@ { + "__inputs": [ + { + "name": "DS_PROMETHEUS-INFRA", + "label": "prometheus-infra", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], "__requires": [ { "type": "grafana", @@ -12,7 +22,7 @@ "name": "Graph", "version": "" }, - { + { "type": "datasource", "id": "prometheus", "name": "Prometheus", @@ -49,7 +59,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "prometheus", + "datasource": "${DS_PROMETHEUS-INFRA}", "fill": 1, "id": 1, "legend": { @@ -125,7 +135,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "prometheus", + "datasource": "${DS_PROMETHEUS-INFRA}", "fill": 1, "id": 4, "legend": { @@ -213,7 +223,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "prometheus", + "datasource": "${DS_PROMETHEUS-INFRA}", "fill": 1, "id": 2, "legend": { @@ -289,7 +299,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "prometheus", + "datasource": "${DS_PROMETHEUS-INFRA}", "fill": 1, "id": 5, "legend": { @@ -377,7 +387,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "prometheus", + "datasource": "${DS_PROMETHEUS-INFRA}", "fill": 1, "id": 3, "legend": { @@ -453,7 +463,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "prometheus", + "datasource": "${DS_PROMETHEUS-INFRA}", "fill": 1, "id": 6, "legend": { @@ -541,7 +551,7 @@ { "allValue": null, "current": {}, - "datasource": "prometheus", + "datasource": "${DS_PROMETHEUS-INFRA}", "hide": 0, "includeAll": false, "label": "Instance",