From 84f265c54c6001f787a4a51a6920d6fa90c71fa8 Mon Sep 17 00:00:00 2001 From: movsb Date: Wed, 18 Dec 2024 19:16:33 +0800 Subject: [PATCH] update grafana --- setup/data/grafana.json | 465 +++++++--------------------------------- 1 file changed, 77 insertions(+), 388 deletions(-) diff --git a/setup/data/grafana.json b/setup/data/grafana.json index 88c1890d..4da548ef 100644 --- a/setup/data/grafana.json +++ b/setup/data/grafana.json @@ -20,14 +20,9 @@ "graphTooltip": 0, "id": 2, "links": [], - "liveNow": false, "panels": [ { "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "o1J7POZnk" - }, "gridPos": { "h": 1, "w": 24, @@ -36,15 +31,6 @@ }, "id": 2, "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "o1J7POZnk" - }, - "refId": "A" - } - ], "title": "基础指标", "type": "row" }, @@ -53,7 +39,7 @@ "type": "prometheus", "uid": "o1J7POZnk" }, - "description": "自建站以来的时间长度。", + "description": "", "fieldConfig": { "defaults": { "color": { @@ -85,6 +71,7 @@ "graphMode": "none", "justifyMode": "auto", "orientation": "auto", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -97,7 +84,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.0.0", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -116,179 +103,6 @@ "title": "建站时长", "type": "stat" }, - { - "datasource": { - "type": "prometheus", - "uid": "o1J7POZnk" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 4, - "y": 1 - }, - "id": 37, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.0.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "o1J7POZnk" - }, - "editorMode": "code", - "expr": "vps_bandwidth_quota", - "instant": false, - "legendFormat": "{{name}}", - "range": true, - "refId": "A" - } - ], - "title": "流量配额", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "o1J7POZnk" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "fieldMinMax": false, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "green", - "value": 15 - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 8, - "y": 1 - }, - "id": 40, - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto", - "text": {} - }, - "pluginVersion": "11.0.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "o1J7POZnk" - }, - "editorMode": "code", - "exemplar": false, - "expr": "vps_bandwidth_quota-vps_bandwidth_used", - "hide": false, - "instant": true, - "legendFormat": "{{name}}", - "range": false, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "o1J7POZnk" - }, - "editorMode": "code", - "exemplar": false, - "expr": "vps_bandwidth_quota", - "hide": false, - "instant": true, - "legendFormat": "{{name}}-quota", - "range": false, - "refId": "B" - } - ], - "title": "流量剩余", - "transformations": [ - { - "id": "configFromData", - "options": { - "applyTo": { - "id": "byType", - "options": "number" - }, - "configRefId": "B", - "mappings": [ - { - "fieldName": "twofei.com-quota", - "handlerKey": "max", - "reducerId": "lastNotNull" - } - ] - } - } - ], - "type": "gauge" - }, { "datasource": { "type": "prometheus", @@ -309,7 +123,7 @@ }, { "color": "green", - "value": 15 + "value": 7 } ] } @@ -319,15 +133,16 @@ "gridPos": { "h": 4, "w": 4, - "x": 0, - "y": 5 + "x": 4, + "y": 1 }, - "id": 42, + "id": 41, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -339,7 +154,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.0.0", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -348,14 +163,14 @@ }, "editorMode": "code", "exemplar": false, - "expr": "taoblog_domain_domain_days_left", + "expr": "taoblog_domain_cert_days_left", "instant": true, "legendFormat": "__auto", "range": false, "refId": "A" } ], - "title": "域名有效期剩余天数", + "title": "证书有效期剩余天数", "type": "stat" }, { @@ -363,6 +178,7 @@ "type": "prometheus", "uid": "o1J7POZnk" }, + "description": "嗯?-1?那一定是博主刚刚悄悄更新了代码、还没来得及自动刷新。", "fieldConfig": { "defaults": { "color": { @@ -378,7 +194,7 @@ }, { "color": "green", - "value": 7 + "value": 15 } ] } @@ -388,15 +204,16 @@ "gridPos": { "h": 4, "w": 4, - "x": 4, - "y": 5 + "x": 8, + "y": 1 }, - "id": 41, + "id": 42, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -408,7 +225,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.0.0", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -417,135 +234,23 @@ }, "editorMode": "code", "exemplar": false, - "expr": "taoblog_domain_cert_days_left", + "expr": "taoblog_domain_domain_days_left", "instant": true, "legendFormat": "__auto", "range": false, "refId": "A" } ], - "title": "证书有效期剩余天数", + "title": "域名有效期剩余天数", "type": "stat" }, - { - "datasource": { - "type": "prometheus", - "uid": "o1J7POZnk" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "fieldMinMax": false, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "green", - "value": 15 - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 8, - "y": 5 - }, - "id": 43, - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto", - "text": {} - }, - "pluginVersion": "11.0.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "o1J7POZnk" - }, - "disableTextWrap": false, - "editorMode": "builder", - "exemplar": false, - "expr": "node_filesystem_avail_bytes{mountpoint=\"/\"}", - "fullMetaSearch": false, - "includeNullMetadata": true, - "instant": true, - "legendFormat": "可用:{{mountpoint}}", - "range": false, - "refId": "A", - "useBackend": false - }, - { - "datasource": { - "type": "prometheus", - "uid": "o1J7POZnk" - }, - "disableTextWrap": false, - "editorMode": "builder", - "exemplar": false, - "expr": "node_filesystem_size_bytes{mountpoint=\"/\"}", - "fullMetaSearch": false, - "hide": false, - "includeNullMetadata": true, - "instant": true, - "legendFormat": "总共:{{mountpoint}}", - "range": false, - "refId": "B", - "useBackend": false - } - ], - "title": "磁盘剩余", - "transformations": [ - { - "id": "configFromData", - "options": { - "applyTo": { - "id": "byType", - "options": "number" - }, - "configRefId": "B", - "mappings": [ - { - "fieldName": "总共:/", - "handlerKey": "max" - } - ] - } - } - ], - "type": "gauge" - }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 9 + "y": 5 }, "id": 34, "panels": [], @@ -570,6 +275,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -621,7 +327,7 @@ "h": 7, "w": 6, "x": 0, - "y": 10 + "y": 6 }, "id": 36, "options": { @@ -637,6 +343,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -674,6 +381,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -724,7 +432,7 @@ "h": 7, "w": 5, "x": 6, - "y": 10 + "y": 6 }, "id": 35, "options": { @@ -740,6 +448,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -777,6 +486,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -827,7 +537,7 @@ "h": 7, "w": 5, "x": 11, - "y": 10 + "y": 6 }, "id": 39, "options": { @@ -843,6 +553,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -861,28 +572,15 @@ }, { "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "o1J7POZnk" - }, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 17 + "y": 13 }, "id": 17, "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "o1J7POZnk" - }, - "refId": "A" - } - ], - "title": "访问统计", + "title": "访问统计(自然日)", "type": "row" }, { @@ -915,7 +613,7 @@ "h": 4, "w": 4, "x": 0, - "y": 18 + "y": 14 }, "hideTimeOverride": true, "id": 19, @@ -924,6 +622,7 @@ "graphMode": "area", "justifyMode": "auto", "orientation": "auto", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -936,7 +635,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.0.0", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -1052,7 +751,7 @@ "h": 12, "w": 4, "x": 4, - "y": 18 + "y": 14 }, "hideTimeOverride": true, "id": 22, @@ -1069,7 +768,7 @@ "showHeader": true, "sortBy": [] }, - "pluginVersion": "11.0.0", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -1136,7 +835,7 @@ "h": 4, "w": 4, "x": 8, - "y": 18 + "y": 14 }, "hideTimeOverride": true, "id": 38, @@ -1145,6 +844,7 @@ "graphMode": "area", "justifyMode": "auto", "orientation": "auto", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -1157,7 +857,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.0.0", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -1277,7 +977,7 @@ "h": 12, "w": 4, "x": 12, - "y": 18 + "y": 14 }, "hideTimeOverride": true, "id": 15, @@ -1294,7 +994,7 @@ "showHeader": true, "sortBy": [] }, - "pluginVersion": "11.0.0", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -1361,7 +1061,7 @@ "h": 4, "w": 4, "x": 0, - "y": 22 + "y": 18 }, "hideTimeOverride": true, "id": 20, @@ -1370,6 +1070,7 @@ "graphMode": "area", "justifyMode": "auto", "orientation": "auto", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -1382,7 +1083,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.0.0", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -1433,7 +1134,7 @@ "h": 4, "w": 4, "x": 8, - "y": 22 + "y": 18 }, "hideTimeOverride": true, "id": 13, @@ -1442,6 +1143,7 @@ "graphMode": "area", "justifyMode": "auto", "orientation": "auto", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -1454,7 +1156,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.0.0", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -1492,7 +1194,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null } ] }, @@ -1504,7 +1207,7 @@ "h": 4, "w": 4, "x": 0, - "y": 26 + "y": 22 }, "hideTimeOverride": true, "id": 21, @@ -1513,6 +1216,7 @@ "graphMode": "area", "justifyMode": "auto", "orientation": "auto", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -1525,7 +1229,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.0.0", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -1563,7 +1267,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null } ] }, @@ -1575,7 +1280,7 @@ "h": 4, "w": 4, "x": 8, - "y": 26 + "y": 22 }, "hideTimeOverride": true, "id": 12, @@ -1584,6 +1289,7 @@ "graphMode": "area", "justifyMode": "auto", "orientation": "auto", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -1596,7 +1302,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.0.0", + "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -1682,7 +1388,7 @@ "h": 9, "w": 16, "x": 0, - "y": 30 + "y": 26 }, "hideTimeOverride": true, "id": 25, @@ -1737,27 +1443,14 @@ }, { "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "o1J7POZnk" - }, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 39 + "y": 35 }, "id": 27, "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "o1J7POZnk" - }, - "refId": "A" - } - ], "title": "访客来源统计", "type": "row" }, @@ -1786,7 +1479,7 @@ "h": 17, "w": 8, "x": 0, - "y": 40 + "y": 36 }, "id": 32, "options": { @@ -1857,7 +1550,7 @@ "h": 17, "w": 8, "x": 8, - "y": 40 + "y": 36 }, "id": 31, "options": { @@ -1902,37 +1595,33 @@ } ], "title": "操作系统 (最近24小时)", + "transformations": [ + { + "id": "renameByRegex", + "options": { + "regex": "\\s+", + "renamePattern": "Others" + } + } + ], "type": "piechart" } ], - "refresh": "5s", - "schemaVersion": 39, + "preload": false, + "refresh": "10s", + "schemaVersion": 40, "tags": [], "templating": { "list": [] }, "time": { - "from": "now-30m", + "from": "now-3h", "to": "now" }, - "timeRangeUpdatedDuringEditOrView": false, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ] - }, + "timepicker": {}, "timezone": "", "title": "陪她去流浪", "uid": "_2g5VpWnz", - "version": 52, + "version": 58, "weekStart": "" } \ No newline at end of file