Skip to content

Commit

Permalink
fix(update_dashboards): Updating datasource and adding prefix
Browse files Browse the repository at this point in the history
* Update dashboards

This queries prometheus datasource name from first templated variable 'datasource' and use it in all panels. This ensures that dashboard would work in the grafana environment with any prometheus datasource name.

Also prefixes esx.json dashboard with 'VMware' so dashboards are better sorted in grafana and easier to find.

* Add dashboard tags
  • Loading branch information
v-zhuravlev authored Oct 11, 2022
1 parent f32eaa9 commit a42968f
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 80 deletions.
52 changes: 27 additions & 25 deletions dashboards/cluster.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "Prometheus",
"datasource": "$datasource",
"format": "short",
"gauge": {
"maxValue": 100,
Expand Down Expand Up @@ -112,7 +112,7 @@
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "Prometheus",
"datasource": "$datasource",
"format": "hertz",
"gauge": {
"maxValue": 100,
Expand Down Expand Up @@ -193,7 +193,7 @@
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "Prometheus",
"datasource": "$datasource",
"format": "decmbytes",
"gauge": {
"maxValue": 100,
Expand Down Expand Up @@ -274,7 +274,7 @@
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "Prometheus",
"datasource": "$datasource",
"format": "none",
"gauge": {
"maxValue": 100,
Expand Down Expand Up @@ -355,7 +355,7 @@
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "Prometheus",
"datasource": "$datasource",
"format": "none",
"gauge": {
"maxValue": 100,
Expand Down Expand Up @@ -439,7 +439,7 @@
},
{
"cacheTimeout": null,
"datasource": "Prometheus",
"datasource": "$datasource",
"gridPos": {
"h": 5,
"w": 4,
Expand Down Expand Up @@ -504,7 +504,7 @@
},
{
"cacheTimeout": null,
"datasource": "Prometheus",
"datasource": "$datasource",
"gridPos": {
"h": 5,
"w": 4,
Expand Down Expand Up @@ -569,7 +569,7 @@
},
{
"cacheTimeout": null,
"datasource": "Prometheus",
"datasource": "$datasource",
"gridPos": {
"h": 5,
"w": 4,
Expand Down Expand Up @@ -638,7 +638,7 @@
"cacheTimeout": null,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "$datasource",
"fill": 1,
"fillGradient": 0,
"gridPos": {
Expand Down Expand Up @@ -732,7 +732,7 @@
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "Prometheus",
"datasource": "$datasource",
"format": "percent",
"gauge": {
"maxValue": 100,
Expand Down Expand Up @@ -807,7 +807,7 @@
},
{
"cacheTimeout": null,
"datasource": "Prometheus",
"datasource": "$datasource",
"gridPos": {
"h": 5,
"w": 4,
Expand Down Expand Up @@ -872,7 +872,7 @@
},
{
"cacheTimeout": null,
"datasource": "Prometheus",
"datasource": "$datasource",
"gridPos": {
"h": 5,
"w": 4,
Expand Down Expand Up @@ -941,7 +941,7 @@
"cacheTimeout": null,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "$datasource",
"fill": 1,
"fillGradient": 0,
"gridPos": {
Expand Down Expand Up @@ -1032,7 +1032,7 @@
"cacheTimeout": null,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "$datasource",
"decimals": 1,
"fill": 1,
"fillGradient": 0,
Expand Down Expand Up @@ -1124,7 +1124,7 @@
"cacheTimeout": null,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "$datasource",
"decimals": 1,
"fill": 1,
"fillGradient": 0,
Expand Down Expand Up @@ -1216,7 +1216,7 @@
"cacheTimeout": null,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "$datasource",
"fill": 1,
"fillGradient": 0,
"gridPos": {
Expand Down Expand Up @@ -1307,7 +1307,7 @@
"cacheTimeout": null,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "$datasource",
"decimals": 1,
"fill": 1,
"fillGradient": 0,
Expand Down Expand Up @@ -1399,7 +1399,7 @@
"cacheTimeout": null,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "$datasource",
"fill": 1,
"fillGradient": 0,
"gridPos": {
Expand Down Expand Up @@ -1490,7 +1490,7 @@
"cacheTimeout": null,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "$datasource",
"decimals": 1,
"fill": 1,
"fillGradient": 0,
Expand Down Expand Up @@ -1582,7 +1582,7 @@
"cacheTimeout": null,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "$datasource",
"decimals": 1,
"fill": 1,
"fillGradient": 0,
Expand Down Expand Up @@ -1674,7 +1674,7 @@
"cacheTimeout": null,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "$datasource",
"fill": 1,
"fillGradient": 0,
"gridPos": {
Expand Down Expand Up @@ -1765,7 +1765,7 @@
"cacheTimeout": null,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "$datasource",
"fill": 1,
"fillGradient": 0,
"gridPos": {
Expand Down Expand Up @@ -1856,7 +1856,7 @@
"cacheTimeout": null,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "$datasource",
"fill": 1,
"fillGradient": 0,
"gridPos": {
Expand Down Expand Up @@ -1944,7 +1944,9 @@
],
"schemaVersion": 20,
"style": "dark",
"tags": [],
"tags": [
"vmware"
],
"templating": {
"list": [
{
Expand Down Expand Up @@ -1972,7 +1974,7 @@
"cluster1"
]
},
"datasource": "Prometheus",
"datasource": "$datasource",
"definition": "label_values(cluster_name)",
"hide": 0,
"includeAll": false,
Expand Down
41 changes: 31 additions & 10 deletions dashboards/esx.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"name": "datasource",
"label": "prometheus",
"description": "",
"type": "datasource",
Expand Down Expand Up @@ -59,7 +59,7 @@
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"datasource": "${DS_PROMETHEUS}",
"datasource": "${datasource}",
"decimals": 1,
"description": "System uptime",
"format": "s",
Expand Down Expand Up @@ -139,7 +139,7 @@
"rgba(237, 129, 40, 0.89)",
"rgba(245, 54, 54, 0.9)"
],
"datasource": "${DS_PROMETHEUS}",
"datasource": "${datasource}",
"format": "percent",
"gauge": {
"maxValue": 100,
Expand Down Expand Up @@ -218,7 +218,7 @@
"rgba(237, 129, 40, 0.89)",
"rgba(245, 54, 54, 0.9)"
],
"datasource": "${DS_PROMETHEUS}",
"datasource": "${datasource}",
"format": "percent",
"gauge": {
"maxValue": 100,
Expand Down Expand Up @@ -296,7 +296,7 @@
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"datasource": "${DS_PROMETHEUS}",
"datasource": "${datasource}",
"format": "none",
"gauge": {
"maxValue": 100,
Expand Down Expand Up @@ -385,7 +385,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"datasource": "${datasource}",
"decimals": 1,
"fill": 0,
"id": 1,
Expand Down Expand Up @@ -468,7 +468,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"datasource": "${datasource}",
"decimals": 1,
"fill": 1,
"id": 2,
Expand Down Expand Up @@ -557,13 +557,33 @@
],
"schemaVersion": 14,
"style": "dark",
"tags": [],
"tags": [
"vmware",
"esx"
],
"templating": {
"list": [
{
"current": {
"text": "Prometheus",
"value": "Prometheus"
},
"hide": 0,
"includeAll": false,
"label": "Datasource",
"multi": false,
"name": "datasource",
"options": [],
"query": "prometheus",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"allValue": null,
"current": {},
"datasource": "${DS_PROMETHEUS}",
"datasource": "$datasource",
"hide": 0,
"includeAll": false,
"label": "Host:",
Expand Down Expand Up @@ -612,6 +632,7 @@
]
},
"timezone": "browser",
"title": "ESX Hosts Information",
"title": "VMware ESX Hosts Information",
"uid": "ed9d4bbf8801a8f79194b2ce6ead0ffcb8f9952a",
"version": 17
}
Loading

0 comments on commit a42968f

Please sign in to comment.