From f6d1b08a6327a1612032380345918135bab65b22 Mon Sep 17 00:00:00 2001 From: Vitaly Zhuravlev Date: Wed, 11 May 2022 12:17:31 +0400 Subject: [PATCH] Rename DS_LOCALHOST to prometheus $datasource This is more universal approach so dashboard would work no matter how prometheus datasource is named. --- .../dashboards/apache-exporter-full.libsonnet | 36 +++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/prometheus/apache-http-mixin/dashboards/apache-exporter-full.libsonnet b/prometheus/apache-http-mixin/dashboards/apache-exporter-full.libsonnet index 2052641..b4cdfc4 100644 --- a/prometheus/apache-http-mixin/dashboards/apache-exporter-full.libsonnet +++ b/prometheus/apache-http-mixin/dashboards/apache-exporter-full.libsonnet @@ -4,7 +4,7 @@ { __inputs: [ { - name: 'DS_LOCALHOST', + name: 'datasource', label: 'localhost', description: '', type: 'datasource', @@ -62,7 +62,7 @@ 'rgba(237, 129, 40, 0.89)', 'rgba(50, 172, 45, 0.97)', ], - datasource: '${DS_LOCALHOST}', + datasource: '${datasource}', decimals: 1, format: 's', gauge: { @@ -135,7 +135,7 @@ bars: false, dashLength: 10, dashes: false, - datasource: '${DS_LOCALHOST}', + datasource: '${datasource}', decimals: 0, fill: 7, id: 5, @@ -243,7 +243,7 @@ bars: false, dashLength: 10, dashes: false, - datasource: '${DS_LOCALHOST}', + datasource: '${datasource}', decimals: 2, fill: 1, id: 3, @@ -321,7 +321,7 @@ bars: false, dashLength: 10, dashes: false, - datasource: '${DS_LOCALHOST}', + datasource: '${datasource}', decimals: 2, fill: 1, id: 1, @@ -411,7 +411,7 @@ bars: false, dashLength: 10, dashes: false, - datasource: '${DS_LOCALHOST}', + datasource: '${datasource}', decimals: 2, fill: 1, id: 2, @@ -502,7 +502,7 @@ bars: false, dashLength: 10, dashes: false, - datasource: '${DS_LOCALHOST}', + datasource: '${datasource}', decimals: 2, fill: 1, id: 7, @@ -580,7 +580,7 @@ bars: false, dashLength: 10, dashes: false, - datasource: '${DS_LOCALHOST}', + datasource: '${datasource}', decimals: 2, fill: 1, id: 4, @@ -667,10 +667,26 @@ tags: [], templating: { list: [ + { + current: {}, + description: null, + 'error': null, + hide: 0, + includeAll: false, + label: 'Data Source', + multi: false, + name: 'datasource', + options: [], + query: 'prometheus', + refresh: 1, + regex: '', + skipUrlSync: false, + type: 'datasource', + }, { allValue: null, current: {}, - datasource: '${DS_LOCALHOST}', + datasource: '${datasource}', hide: 0, includeAll: false, label: 'host', @@ -690,7 +706,7 @@ { allValue: null, current: {}, - datasource: '${DS_LOCALHOST}', + datasource: '${datasource}', hide: 2, includeAll: false, label: null,