This is an automated email from the ASF dual-hosted git repository. marklau99 pushed a commit to branch seperate-io-dashboard in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit ef52e894d9cd4d675dfee71fbfc120cf6966bc06 Author: Liu Xuxin <[email protected]> AuthorDate: Thu Mar 16 15:21:44 2023 +0800 seperate disk io dashboard apart --- .../Apache-IoTDB-Disk-IO-Dashboard.json | 920 +++++++++++++++++++++ .../Apache-IoTDB-Network-Dashboard.json | 7 +- .../iotdb/metrics/metricsets/disk/DiskMetrics.java | 29 +- 3 files changed, 938 insertions(+), 18 deletions(-) diff --git a/docs/UserGuide/Monitor-Alert/Apache-IoTDB-Disk-IO-Dashboard.json b/docs/UserGuide/Monitor-Alert/Apache-IoTDB-Disk-IO-Dashboard.json new file mode 100644 index 0000000000..d7d64792ae --- /dev/null +++ b/docs/UserGuide/Monitor-Alert/Apache-IoTDB-Disk-IO-Dashboard.json @@ -0,0 +1,920 @@ +{ + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "Prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "9.3.6" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 18, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "axisSoftMax": 1, + "axisSoftMin": 0, + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "line+area" + } + }, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 1 + }, + "id": 2, + "options": { + "legend": { + "calcs": [ + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "asc" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "disk_io_busy_percentage{instance=~\"$instance\", disk_id=~\"$disk\"}", + "legendFormat": "{{disk_id}}", + "range": true, + "refId": "A" + } + ], + "title": "Disk I/O Busy Rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "KBs" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 1 + }, + "id": 4, + "options": { + "legend": { + "calcs": [ + "mean" + ], + "displayMode": "list", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "asc" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "rate(disk_io_size{instance=~\"$instance\", disk_id=~\"$disk\"}[1m])", + "legendFormat": "{{disk_id}}-{{type}}", + "range": true, + "refId": "A" + } + ], + "title": "Disk I/O Throughput", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "iops" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 6, + "options": { + "legend": { + "calcs": [ + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "asc" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "rate(disk_io_ops{instance=~\"$instance\", disk_id=~\"$disk\"}[1m])", + "legendFormat": "{{disk_id}}-{{type}}", + "range": true, + "refId": "A" + } + ], + "title": "Disk I/O Ops", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 10, + "options": { + "legend": { + "calcs": [ + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "asc" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "disk_io_avg_time{instance=~\"$instance\", disk_id=~\"$disk\"}", + "legendFormat": "{{disk_id}}-{{type}}", + "range": true, + "refId": "A" + } + ], + "title": "Disk Per I/O Avg Time", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 17 + }, + "id": 12, + "options": { + "legend": { + "calcs": [ + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "asc" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "disk_io_avg_size{instance=~\"$instance\", disk_id=~\"$disk\"}", + "legendFormat": "{{disk_id}}-{{type}}", + "range": true, + "refId": "A" + } + ], + "title": "Disk I/O Avg Size", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 17 + }, + "id": 8, + "options": { + "legend": { + "calcs": [ + "mean" + ], + "displayMode": "list", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "asc" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "disk_io_avg_queue_size{instance=~\"$instance\", disk_id=~\"$disk\"}", + "legendFormat": "{{disk_id}}", + "range": true, + "refId": "A" + } + ], + "title": "Disk I/O Avg Queue Size", + "type": "timeseries" + } + ], + "title": "Disk Status", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 20, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "KBs" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 1 + }, + "id": 16, + "options": { + "legend": { + "calcs": [ + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "asc" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "rate(process_io_size{instance=~\"$instance\"}[1m])", + "legendFormat": "{{from}}-{{name}}", + "range": true, + "refId": "A" + } + ], + "title": "Process I/O Throughput", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 1 + }, + "id": 14, + "options": { + "legend": { + "calcs": [ + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "asc" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "rate(process_io_ops{instance=~\"$instance\"}[1m])", + "legendFormat": "{{from}}-{{name}}", + "range": true, + "refId": "A" + } + ], + "title": "I/O System Call Rate", + "type": "timeseries" + } + ], + "title": "Process", + "type": "row" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "definition": "label_values(job)", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "job", + "options": [], + "query": { + "query": "label_values(job)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "definition": "label_values(up{job=~\"$job\"},instance)", + "description": "", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "instance", + "options": [], + "query": { + "query": "label_values(up{job=~\"$job\"},instance)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "definition": "label_values(disk_id)", + "hide": 0, + "includeAll": false, + "multi": true, + "name": "disk", + "options": [], + "query": { + "query": "label_values(disk_id)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "15s", + "30s", + "1m", + "5m", + "15m", + "30m" + ] + }, + "timezone": "", + "title": "Apache IoTDB Disk I/O Dashboard", + "uid": "TrJ0dsaVk", + "version": 12, + "weekStart": "" +} \ No newline at end of file diff --git a/docs/UserGuide/Monitor-Alert/Apache-IoTDB-Network-Dashboard.json b/docs/UserGuide/Monitor-Alert/Apache-IoTDB-Network-Dashboard.json index f63d532a7b..66899f7b21 100644 --- a/docs/UserGuide/Monitor-Alert/Apache-IoTDB-Network-Dashboard.json +++ b/docs/UserGuide/Monitor-Alert/Apache-IoTDB-Network-Dashboard.json @@ -415,8 +415,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" } ] } @@ -497,7 +496,7 @@ "description": "", "hide": 0, "includeAll": false, - "multi": false, + "multi": true, "name": "iface", "options": [], "query": { @@ -529,6 +528,6 @@ "timezone": "", "title": "Apache IoTDB Network Dashboard", "uid": "AXEPYc-Vz", - "version": 19, + "version": 2, "weekStart": "" } \ No newline at end of file diff --git a/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/disk/DiskMetrics.java b/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/disk/DiskMetrics.java index 1236ce8367..8184672fb8 100644 --- a/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/disk/DiskMetrics.java +++ b/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/disk/DiskMetrics.java @@ -42,6 +42,7 @@ public class DiskMetrics implements IMetricSet { private static final String ACTUAL_WRITE = "actual_write"; private static final String ACTUAL_READ = "actual_read"; private static final String TYPE = "type"; + private static final String DISK_ID = "disk_id"; private static final String NAME = "name"; private static final String FROM = "from"; private static final String DISK_IO_SIZE = "disk_io_size"; @@ -71,7 +72,7 @@ public class DiskMetrics implements IMetricSet { x -> x.getReadDataSizeForDisk().getOrDefault(diskID, 0.0), TYPE, READ, - NAME, + DISK_ID, diskID); metricService.createAutoGauge( DISK_IO_SIZE, @@ -80,7 +81,7 @@ public class DiskMetrics implements IMetricSet { x -> x.getWriteDataSizeForDisk().getOrDefault(diskID, 0.0), TYPE, WRITE, - NAME, + DISK_ID, diskID); metricService.createAutoGauge( DISK_IO_OPS, @@ -89,7 +90,7 @@ public class DiskMetrics implements IMetricSet { x -> x.getReadOperationCountForDisk().getOrDefault(diskID, 0L), TYPE, READ, - NAME, + DISK_ID, diskID); metricService.createAutoGauge( DISK_IO_OPS, @@ -98,7 +99,7 @@ public class DiskMetrics implements IMetricSet { x -> x.getWriteOperationCountForDisk().getOrDefault(diskID, 0L), TYPE, WRITE, - NAME, + DISK_ID, diskID); metricService.createAutoGauge( DISK_IO_OPS, @@ -107,7 +108,7 @@ public class DiskMetrics implements IMetricSet { x -> x.getMergedReadOperationForDisk().getOrDefault(diskID, 0L), TYPE, MERGED_READ, - NAME, + DISK_ID, diskID); metricService.createAutoGauge( DISK_IO_OPS, @@ -116,7 +117,7 @@ public class DiskMetrics implements IMetricSet { x -> x.getMergedWriteOperationForDisk().getOrDefault(diskID, 0L), TYPE, MERGED_WRITE, - NAME, + DISK_ID, diskID); metricService.createAutoGauge( DISK_IO_TIME, @@ -125,7 +126,7 @@ public class DiskMetrics implements IMetricSet { x -> x.getReadCostTimeForDisk().getOrDefault(diskID, 0L), TYPE, READ, - NAME, + DISK_ID, diskID); metricService.createAutoGauge( DISK_IO_TIME, @@ -134,7 +135,7 @@ public class DiskMetrics implements IMetricSet { x -> x.getWriteCostTimeForDisk().getOrDefault(diskID, 0L), TYPE, WRITE, - NAME, + DISK_ID, diskID); metricService.createAutoGauge( DISK_IO_AVG_TIME, @@ -143,7 +144,7 @@ public class DiskMetrics implements IMetricSet { x -> x.getAvgReadCostTimeOfEachOpsForDisk().getOrDefault(diskID, 0.0), TYPE, READ, - NAME, + DISK_ID, diskID); metricService.createAutoGauge( DISK_IO_AVG_TIME, @@ -152,7 +153,7 @@ public class DiskMetrics implements IMetricSet { x -> x.getAvgWriteCostTimeOfEachOpsForDisk().getOrDefault(diskID, 0.0), TYPE, WRITE, - NAME, + DISK_ID, diskID); metricService.createAutoGauge( DISK_IO_AVG_SIZE, @@ -161,7 +162,7 @@ public class DiskMetrics implements IMetricSet { x -> x.getAvgSizeOfEachReadForDisk().getOrDefault(diskID, 0.0), TYPE, READ, - NAME, + DISK_ID, diskID); metricService.createAutoGauge( DISK_IO_AVG_SIZE, @@ -170,21 +171,21 @@ public class DiskMetrics implements IMetricSet { x -> x.getAvgSizeOfEachWriteForDisk().getOrDefault(diskID, 0.0), TYPE, WRITE, - NAME, + DISK_ID, diskID); metricService.createAutoGauge( DISK_IO_BUSY_PERCENTAGE, MetricLevel.IMPORTANT, diskMetricsManager, x -> x.getIoUtilsPercentage().getOrDefault(diskID, 0.0), - NAME, + DISK_ID, diskID); metricService.createAutoGauge( DISK_IO_QUEUE_SIZE, MetricLevel.IMPORTANT, diskMetricsManager, x -> x.getQueueSizeForDisk().getOrDefault(diskID, 0.0), - NAME, + DISK_ID, diskID); }
