fix: data source was hardcoded

This commit is contained in:
Chris Johnson 2023-03-16 12:03:33 -07:00
parent 5b2ed75850
commit 1b2cf9065b

View File

@ -14,9 +14,7 @@
"target": { "target": {
"limit": 100, "limit": 100,
"matchAny": false, "matchAny": false,
"tags":[ "tags": [],
],
"type": "dashboard" "type": "dashboard"
}, },
"type": "dashboard" "type": "dashboard"
@ -26,16 +24,14 @@
"editable": true, "editable": true,
"fiscalYearStartMonth": 0, "fiscalYearStartMonth": 0,
"graphTooltip": 0, "graphTooltip": 0,
"iteration":1651440933266, "id": 5,
"links":[ "links": [],
],
"liveNow": false, "liveNow": false,
"panels": [ "panels": [
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid":"PBFA97CFB590B2093" "uid": "${data_source}"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -79,9 +75,7 @@
] ]
} }
}, },
"overrides":[ "overrides": []
]
}, },
"gridPos": { "gridPos": {
"h": 4, "h": 4,
@ -104,9 +98,13 @@
}, },
"textMode": "auto" "textMode": "auto"
}, },
"pluginVersion":"8.5.0", "pluginVersion": "9.4.3",
"targets": [ "targets": [
{ {
"datasource": {
"type": "prometheus",
"uid": "${data_source}"
},
"expr": "qbittorrent_up", "expr": "qbittorrent_up",
"format": "time_series", "format": "time_series",
"instant": false, "instant": false,
@ -116,15 +114,13 @@
} }
], ],
"title": "Qbittorrent Status", "title": "Qbittorrent Status",
"transformations":[ "transformations": [],
],
"type": "stat" "type": "stat"
}, },
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid":"PBFA97CFB590B2093" "uid": "${data_source}"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -162,9 +158,7 @@
] ]
} }
}, },
"overrides":[ "overrides": []
]
}, },
"gridPos": { "gridPos": {
"h": 4, "h": 4,
@ -187,7 +181,7 @@
}, },
"textMode": "auto" "textMode": "auto"
}, },
"pluginVersion":"8.5.0", "pluginVersion": "9.4.3",
"targets": [ "targets": [
{ {
"expr": "qbittorrent_connected - qbittorrent_firewalled", "expr": "qbittorrent_connected - qbittorrent_firewalled",
@ -199,15 +193,13 @@
} }
], ],
"title": "Bittorrent network", "title": "Bittorrent network",
"transformations":[ "transformations": [],
],
"type": "stat" "type": "stat"
}, },
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid":"PBFA97CFB590B2093" "uid": "${data_source}"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -242,9 +234,7 @@
] ]
} }
}, },
"overrides":[ "overrides": []
]
}, },
"gridPos": { "gridPos": {
"h": 4, "h": 4,
@ -267,7 +257,7 @@
}, },
"textMode": "auto" "textMode": "auto"
}, },
"pluginVersion":"8.5.0", "pluginVersion": "9.4.3",
"targets": [ "targets": [
{ {
"expr": "qbittorrent_dht_nodes", "expr": "qbittorrent_dht_nodes",
@ -278,21 +268,17 @@
} }
], ],
"title": "DHT nodes", "title": "DHT nodes",
"transformations":[ "transformations": [],
],
"type": "stat" "type": "stat"
}, },
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid":"PBFA97CFB590B2093" "uid": "${data_source}"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"mappings":[ "mappings": [],
],
"thresholds": { "thresholds": {
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
@ -304,9 +290,7 @@
}, },
"unit": "bytes" "unit": "bytes"
}, },
"overrides":[ "overrides": []
]
}, },
"gridPos": { "gridPos": {
"h": 4, "h": 4,
@ -329,12 +313,12 @@
}, },
"textMode": "auto" "textMode": "auto"
}, },
"pluginVersion":"8.5.0", "pluginVersion": "9.4.3",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid":"PBFA97CFB590B2093" "uid": "${data_source}"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "sum by (app) (qbittorrent_dl_info_data_total)", "expr": "sum by (app) (qbittorrent_dl_info_data_total)",
@ -350,13 +334,11 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid":"PBFA97CFB590B2093" "uid": "${data_source}"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"mappings":[ "mappings": [],
],
"thresholds": { "thresholds": {
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
@ -368,9 +350,7 @@
}, },
"unit": "bytes" "unit": "bytes"
}, },
"overrides":[ "overrides": []
]
}, },
"gridPos": { "gridPos": {
"h": 4, "h": 4,
@ -393,12 +373,12 @@
}, },
"textMode": "auto" "textMode": "auto"
}, },
"pluginVersion":"8.5.0", "pluginVersion": "9.4.3",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid":"PBFA97CFB590B2093" "uid": "${data_source}"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "sum by (app) (qbittorrent_up_info_data_total)", "expr": "sum by (app) (qbittorrent_up_info_data_total)",
@ -414,13 +394,11 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid":"PBFA97CFB590B2093" "uid": "${data_source}"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"mappings":[ "mappings": [],
],
"thresholds": { "thresholds": {
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
@ -432,9 +410,7 @@
}, },
"unit": "none" "unit": "none"
}, },
"overrides":[ "overrides": []
]
}, },
"gridPos": { "gridPos": {
"h": 4, "h": 4,
@ -457,12 +433,12 @@
}, },
"textMode": "auto" "textMode": "auto"
}, },
"pluginVersion":"8.5.0", "pluginVersion": "9.4.3",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid":"PBFA97CFB590B2093" "uid": "${data_source}"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "(sum by (app) (qbittorrent_up_info_data_total)) / (sum by (app) (qbittorrent_dl_info_data_total))", "expr": "(sum by (app) (qbittorrent_up_info_data_total)) / (sum by (app) (qbittorrent_dl_info_data_total))",
@ -478,14 +454,12 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid":"PBFA97CFB590B2093" "uid": "${data_source}"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"decimals": 1, "decimals": 1,
"mappings":[ "mappings": [],
],
"max": 48000000, "max": 48000000,
"min": 0, "min": 0,
"thresholds": { "thresholds": {
@ -503,9 +477,7 @@
}, },
"unit": "binBps" "unit": "binBps"
}, },
"overrides":[ "overrides": []
]
}, },
"gridPos": { "gridPos": {
"h": 4, "h": 4,
@ -526,7 +498,7 @@
"showThresholdLabels": false, "showThresholdLabels": false,
"showThresholdMarkers": true "showThresholdMarkers": true
}, },
"pluginVersion":"8.5.0", "pluginVersion": "9.4.3",
"targets": [ "targets": [
{ {
"expr": "rate(qbittorrent_dl_info_data_total[2m])", "expr": "rate(qbittorrent_dl_info_data_total[2m])",
@ -542,14 +514,12 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid":"PBFA97CFB590B2093" "uid": "${data_source}"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"decimals": 1, "decimals": 1,
"mappings":[ "mappings": [],
],
"max": 18000000, "max": 18000000,
"min": 0, "min": 0,
"thresholds": { "thresholds": {
@ -567,9 +537,7 @@
}, },
"unit": "binBps" "unit": "binBps"
}, },
"overrides":[ "overrides": []
]
}, },
"gridPos": { "gridPos": {
"h": 4, "h": 4,
@ -590,7 +558,7 @@
"showThresholdLabels": false, "showThresholdLabels": false,
"showThresholdMarkers": true "showThresholdMarkers": true
}, },
"pluginVersion":"8.5.0", "pluginVersion": "9.4.3",
"targets": [ "targets": [
{ {
"expr": "rate(qbittorrent_up_info_data_total[2m])", "expr": "rate(qbittorrent_up_info_data_total[2m])",
@ -605,15 +573,13 @@
"type": "gauge" "type": "gauge"
}, },
{ {
"aliasColors":{ "aliasColors": {},
},
"bars": false, "bars": false,
"dashLength": 10, "dashLength": 10,
"dashes": false, "dashes": false,
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid":"PBFA97CFB590B2093" "uid": "${data_source}"
}, },
"fill": 1, "fill": 1,
"fillGradient": 0, "fillGradient": 0,
@ -641,13 +607,11 @@
"alertThreshold": true "alertThreshold": true
}, },
"percentage": false, "percentage": false,
"pluginVersion":"8.5.0", "pluginVersion": "9.4.3",
"pointradius": 2, "pointradius": 2,
"points": false, "points": false,
"renderer": "flot", "renderer": "flot",
"seriesOverrides":[ "seriesOverrides": [],
],
"spaceLength": 10, "spaceLength": 10,
"stack": false, "stack": false,
"steppedLine": false, "steppedLine": false,
@ -665,12 +629,8 @@
"refId": "B" "refId": "B"
} }
], ],
"thresholds":[ "thresholds": [],
"timeRegions": [],
],
"timeRegions":[
],
"title": "Transfer Rates", "title": "Transfer Rates",
"tooltip": { "tooltip": {
"shared": true, "shared": true,
@ -681,9 +641,7 @@
"xaxis": { "xaxis": {
"mode": "time", "mode": "time",
"show": true, "show": true,
"values":[ "values": []
]
}, },
"yaxes": [ "yaxes": [
{ {
@ -702,15 +660,13 @@
} }
}, },
{ {
"aliasColors":{ "aliasColors": {},
},
"bars": true, "bars": true,
"dashLength": 10, "dashLength": 10,
"dashes": false, "dashes": false,
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid":"PBFA97CFB590B2093" "uid": "${data_source}"
}, },
"fill": 1, "fill": 1,
"fillGradient": 0, "fillGradient": 0,
@ -735,21 +691,17 @@
}, },
"lines": false, "lines": false,
"linewidth": 0, "linewidth": 0,
"links":[ "links": [],
],
"nullPointMode": "null as zero", "nullPointMode": "null as zero",
"options": { "options": {
"alertThreshold": true "alertThreshold": true
}, },
"percentage": false, "percentage": false,
"pluginVersion":"8.5.0", "pluginVersion": "9.4.3",
"pointradius": 2, "pointradius": 2,
"points": false, "points": false,
"renderer": "flot", "renderer": "flot",
"seriesOverrides":[ "seriesOverrides": [],
],
"spaceLength": 10, "spaceLength": 10,
"stack": true, "stack": true,
"steppedLine": true, "steppedLine": true,
@ -761,12 +713,8 @@
"refId": "A" "refId": "A"
} }
], ],
"thresholds":[ "thresholds": [],
"timeRegions": [],
],
"timeRegions":[
],
"title": "Torrents by status", "title": "Torrents by status",
"tooltip": { "tooltip": {
"shared": true, "shared": true,
@ -777,9 +725,7 @@
"xaxis": { "xaxis": {
"mode": "time", "mode": "time",
"show": true, "show": true,
"values":[ "values": []
]
}, },
"yaxes": [ "yaxes": [
{ {
@ -800,7 +746,7 @@
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid":"PBFA97CFB590B2093" "uid": "${data_source}"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -814,13 +760,9 @@
"viz": false "viz": false
} }
}, },
"mappings":[ "mappings": []
]
}, },
"overrides":[ "overrides": []
]
}, },
"gridPos": { "gridPos": {
"h": 10, "h": 10,
@ -829,13 +771,12 @@
"y": 14 "y": 14
}, },
"id": 12, "id": 12,
"links":[ "links": [],
],
"options": { "options": {
"legend": { "legend": {
"displayMode": "list", "displayMode": "list",
"placement":"bottom" "placement": "bottom",
"showLegend": true
}, },
"pieType": "pie", "pieType": "pie",
"reduceOptions": { "reduceOptions": {
@ -864,11 +805,10 @@
} }
], ],
"refresh": "10s", "refresh": "10s",
"schemaVersion":36, "revision": 1,
"schemaVersion": 38,
"style": "dark", "style": "dark",
"tags":[ "tags": [],
],
"templating": { "templating": {
"list": [ "list": [
{ {
@ -880,7 +820,7 @@
}, },
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid":"PBFA97CFB590B2093" "uid": "${data_source}"
}, },
"definition": "label_values(qbittorrent_torrents_count, category)", "definition": "label_values(qbittorrent_torrents_count, category)",
"hide": 0, "hide": 0,
@ -888,9 +828,7 @@
"label": "Categories", "label": "Categories",
"multi": true, "multi": true,
"name": "categories", "name": "categories",
"options":[ "options": [],
],
"query": { "query": {
"query": "label_values(qbittorrent_torrents_count, category)", "query": "label_values(qbittorrent_torrents_count, category)",
"refId": "Prometheus-categories-Variable-Query" "refId": "Prometheus-categories-Variable-Query"
@ -903,6 +841,25 @@
"tagsQuery": "", "tagsQuery": "",
"type": "query", "type": "query",
"useTags": false "useTags": false
},
{
"current": {
"selected": true,
"text": "Prometheus",
"value": "Prometheus"
},
"hide": 0,
"includeAll": false,
"label": "Data Source",
"multi": false,
"name": "data_source",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
} }
] ]
}, },
@ -910,9 +867,7 @@
"from": "now-1h", "from": "now-1h",
"to": "now" "to": "now"
}, },
"timepicker":{ "timepicker": {},
},
"timezone": "", "timezone": "",
"title": "Qbittorrent", "title": "Qbittorrent",
"uid": "eKyTETFMk", "uid": "eKyTETFMk",