Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(grafana): Allow selecting datasource for grafana dashboard. Closes #1987 #1988

Merged
merged 2 commits into from
Jun 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 40 additions & 21 deletions examples/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "Prometheus",
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"custom": {}
Expand Down Expand Up @@ -107,7 +107,7 @@
},
{
"cacheTimeout": null,
"datasource": null,
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -185,7 +185,7 @@
"cacheTimeout": null,
"dashLength": 10,
"dashes": false,
"datasource": null,
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"custom": {}
Expand Down Expand Up @@ -279,7 +279,7 @@
},
{
"collapsed": true,
"datasource": null,
"datasource": "$datasource",
"gridPos": {
"h": 1,
"w": 24,
Expand All @@ -290,7 +290,7 @@
"panels": [
{
"cacheTimeout": null,
"datasource": "Prometheus",
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -370,7 +370,7 @@
},
{
"cacheTimeout": null,
"datasource": "Prometheus",
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -450,7 +450,7 @@
},
{
"cacheTimeout": null,
"datasource": "Prometheus",
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -530,7 +530,7 @@
},
{
"cacheTimeout": null,
"datasource": "Prometheus",
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -607,7 +607,7 @@
},
{
"cacheTimeout": null,
"datasource": "Prometheus",
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -687,7 +687,7 @@
},
{
"cacheTimeout": null,
"datasource": "Prometheus",
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -764,7 +764,7 @@
},
{
"cacheTimeout": null,
"datasource": "Prometheus",
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -846,7 +846,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"custom": {}
Expand Down Expand Up @@ -952,7 +952,7 @@
"mode": "spectrum"
},
"dataFormat": "tsbuckets",
"datasource": null,
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"custom": {}
Expand Down Expand Up @@ -1014,7 +1014,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"custom": {}
Expand Down Expand Up @@ -1112,7 +1112,7 @@
},
{
"collapsed": true,
"datasource": null,
"datasource": "$datasource",
"gridPos": {
"h": 1,
"w": 24,
Expand All @@ -1122,7 +1122,7 @@
"id": 32,
"panels": [
{
"datasource": null,
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -1186,7 +1186,7 @@
"type": "table"
},
{
"datasource": null,
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -1246,7 +1246,7 @@
"type": "stat"
},
{
"datasource": null,
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -1309,7 +1309,7 @@
"type": "stat"
},
{
"datasource": null,
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
Expand Down Expand Up @@ -1382,14 +1382,33 @@
"tags": [],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "prometheus",
"value": "prometheus"
},
"hide": 0,
"definition": "datasource(prometheus)",
"description": "rollout datasource",
"multi": false,
"name": "datasource",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"allValue": null,
"current": {
"selected": false,
"text": "default",
"value": "default"
},
"datasource": null,
"datasource": "$datasource",
"definition": "label_values(rollout_info,namespace)",
"description": "rollout namespace",
"error": null,
Expand Down Expand Up @@ -1420,7 +1439,7 @@
"text": "",
"value": ""
},
"datasource": null,
"datasource": "$datasource",
"definition": "label_values(rollout_info{namespace=\"$rollout_namespace\"},name)",
"description": "rollout name",
"error": null,
Expand Down