diff --git a/deploy/sample/grafana-dashboard.json b/deploy/sample/grafana-dashboard.json new file mode 100644 index 000000000..b3a0b2994 --- /dev/null +++ b/deploy/sample/grafana-dashboard.json @@ -0,0 +1,1184 @@ +{ + "Comments": [ + "This Grafana dashboard is taken from https://grafana.com/grafana/dashboards/7845.", + "ZFS-LocalPV volumes related graphs are added." + ], + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "Prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "6.4.2" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "${DS_PROMETHEUS}", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Graphs ZFS ARC and ARC L2 Hit %, Hits, Misses, Size, Zpool and Volume", + "editable": true, + "gnetId": 7845, + "graphTooltip": 0, + "id": null, + "iteration": 1574354030467, + "links": [], + "panels": [ + { + "collapsed": false, + "datasource": "${DS_PROMETHEUS}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 34, + "panels": [], + "title": "Volume Capacity", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "decimals": 0, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 35, + "legend": { + "alignAsTable": false, + "avg": true, + "current": false, + "hideEmpty": false, + "hideZero": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sideWidth": 350, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "(kubelet_volume_stats_used_bytes{job=\"kubelet\",instance=~\"$node:.*\"} * 100) / kubelet_volume_stats_capacity_bytes{job=\"kubelet\",instance=~\"$node:.*\"}", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{persistentvolumeclaim}}", + "refId": "A", + "step": 2, + "target": "" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Used Space", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "percent", + "label": "", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "datasource": "${DS_PROMETHEUS}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 8 + }, + "id": 26, + "panels": [], + "title": "Pools", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "decimals": 0, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 19, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "sideWidth": 350, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(node_zfs_zpool_rtime{job=\"node-exporter\",instance=\"$node:$port\"}[5m])", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{zpool}} - read", + "refId": "A", + "step": 2, + "target": "" + }, + { + "expr": "irate(node_zfs_zpool_wtime{job=\"node-exporter\",instance=~\"$node:$port\"}[5m])", + "format": "time_series", + "hide": false, + "intervalFactor": 2, + "legendFormat": "{{zpool}} - write", + "refId": "B", + "step": 2, + "target": "" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "ZPOOL - Time", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "ns", + "label": "", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "decimals": 0, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 20, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "sideWidth": 350, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(node_zfs_zpool_reads{job=\"node-exporter\",instance=~\"$node:$port\"}[5m])", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{zpool}} - reads", + "refId": "A", + "step": 2, + "target": "" + }, + { + "expr": "irate(node_zfs_zpool_writes{job=\"node-exporter\",instance=~\"$node:$port\"}[5m])", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{zpool}} - writes", + "refId": "B", + "step": 2, + "target": "" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "ZPOOL - Ops", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "none", + "label": "", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "datasource": "${DS_PROMETHEUS}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 16 + }, + "id": 24, + "panels": [], + "title": "ARC", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "decimals": 0, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 17 + }, + "id": 14, + "legend": { + "alignAsTable": false, + "avg": true, + "current": false, + "hideEmpty": false, + "hideZero": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sideWidth": 350, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(node_zfs_arc_demand_data_hits{job=\"node-exporter\",instance=~\"$node:$port\"}[5m]) / (irate(node_zfs_arc_demand_data_hits{job=\"node-exporter\",instance=~\"$node:$port\"}[5m]) + irate(node_zfs_arc_demand_data_misses{job=\"node-exporter\",instance=~\"$node:$port\"}[5m])) * 100", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "data", + "refId": "A", + "step": 2, + "target": "" + }, + { + "expr": "irate(node_zfs_arc_demand_metadata_hits{job=\"node-exporter\",instance=~\"$node:$port\"}[5m]) / (irate(node_zfs_arc_demand_metadata_hits{job=\"node-exporter\",instance=~\"$node:$port\"}[5m]) + irate(node_zfs_arc_demand_metadata_misses{job=\"node-exporter\",instance=~\"$node:$port\"}[5m])) * 100", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "metadata", + "refId": "B", + "step": 2, + "target": "" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "ARC - Hit %", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "percent", + "label": "", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "decimals": 0, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 17 + }, + "id": 13, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sideWidth": 350, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(node_zfs_arc_demand_data_hits{job=\"node-exporter\",instance=~\"$node:$port\"}[5m])", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "data_hits", + "refId": "A", + "step": 2, + "target": "" + }, + { + "expr": "irate(node_zfs_arc_demand_metadata_hits{job=\"node-exporter\",instance=~\"$node:$port\"}[5m])", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "metadata_hits", + "refId": "B", + "step": 2, + "target": "" + }, + { + "expr": "irate(node_zfs_arc_demand_data_misses{job=\"node-exporter\",instance=~\"$node:$port\"}[5m])", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "data_misses", + "refId": "C", + "step": 2, + "target": "" + }, + { + "expr": "irate(node_zfs_arc_demand_metadata_misses{job=\"node-exporter\",instance=~\"$node:$port\"}[5m])", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "metadata_misses", + "refId": "D", + "step": 2, + "target": "" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "ARC - Hits, Misses", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "none", + "label": "", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 23 + }, + "id": 15, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "sideWidth": 350, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "node_zfs_arc_data_size{job=\"node-exporter\",instance=~\"$node:$port\"}", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 2, + "legendFormat": "data", + "refId": "I", + "step": 2, + "target": "" + }, + { + "expr": "node_zfs_arc_metadata_size{job=\"node-exporter\",instance=~\"$node:$port\"}", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "metadata", + "refId": "D", + "step": 2, + "target": "" + }, + { + "expr": "node_zfs_arc_anon_size{job=\"node-exporter\",instance=~\"$node:$port\"}", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 2, + "legendFormat": "anon", + "refId": "B", + "step": 2, + "target": "" + }, + { + "expr": "node_zfs_arc_hdr_size{job=\"node-exporter\",instance=~\"$node:$port\"}", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "hdr", + "refId": "C", + "step": 2, + "target": "" + }, + { + "expr": "node_zfs_arc_other_size{job=\"node-exporter\",instance=~\"$node:$port\"}", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "other", + "refId": "J", + "step": 2, + "target": "" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "ARC - Size", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "label": "", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "datasource": "${DS_PROMETHEUS}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 30 + }, + "id": 22, + "panels": [], + "title": "ARC L2", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "decimals": 0, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 31 + }, + "id": 16, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "hideEmpty": false, + "hideZero": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sideWidth": 350, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(node_zfs_arc_l2_hits{job=\"node-exporter\",instance=~\"$node:$port\"}[5m]) / (irate(node_zfs_arc_l2_hits{job=\"node-exporter\",instance=~\"$node:$port\"}[5m]) + irate(node_zfs_arc_l2_misses{job=\"node-exporter\",instance=~\"$node:$port\"}[5m])) * 100", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "L2", + "refId": "A", + "step": 2, + "target": "" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "ARC L2 - Hit %", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "percent", + "label": "", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "decimals": 0, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 31 + }, + "id": 17, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sideWidth": 350, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(node_zfs_arc_l2_hits{job=\"node-exporter\",instance=~\"$node:$port\"}[5m])", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "hits", + "refId": "A", + "step": 2, + "target": "" + }, + { + "expr": "irate(node_zfs_arc_l2_misses{job=\"node-exporter\",instance=~\"$node:$port\"}[5m])", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "misses", + "refId": "B", + "step": 2, + "target": "" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "ARC L2 - Hits, Misses", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "none", + "label": "", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 38 + }, + "id": 18, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "sideWidth": 350, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "node_zfs_arc_l2_asize{job=\"node-exporter\",instance=~\"$node:$port\"}", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 2, + "legendFormat": "asize", + "refId": "I", + "step": 2, + "target": "" + }, + { + "expr": "node_zfs_arc_l2_hdr_size{job=\"node-exporter\",instance=~\"$node:$port\"}", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "metadata", + "refId": "D", + "step": 2, + "target": "" + }, + { + "expr": "node_zfs_arc_l2_size{job=\"node-exporter\",instance=~\"$node:$port\"}", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 2, + "legendFormat": "size", + "refId": "B", + "step": 2, + "target": "" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "ARC L2 - Size", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "label": "", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "10s", + "schemaVersion": 20, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "definition": "label_values(node_exporter_build_info{job=~\"node-exporter\"}, instance)", + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "node", + "options": [], + "query": "label_values(node_exporter_build_info{job=~\"node-exporter\"}, instance)", + "refresh": 1, + "regex": "/([^:]+):.*/", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "definition": "label_values(node_exporter_build_info{instance=~\"$node:(.*)\"}, instance)", + "hide": 2, + "includeAll": false, + "label": null, + "multi": false, + "name": "port", + "options": [], + "query": "label_values(node_exporter_build_info{instance=~\"$node:(.*)\"}, instance)", + "refresh": 1, + "regex": "/[^:]+:(.*)/", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "browser", + "title": "ZFS-LocalPV", + "uid": "YLum8s2ik", + "version": 1 +} diff --git a/deploy/sample/vol-stats.png b/deploy/sample/vol-stats.png new file mode 100644 index 000000000..c3dd2bb30 Binary files /dev/null and b/deploy/sample/vol-stats.png differ diff --git a/docs/grafana-dashboard.md b/docs/grafana-dashboard.md new file mode 100644 index 000000000..42892a102 --- /dev/null +++ b/docs/grafana-dashboard.md @@ -0,0 +1,130 @@ +# Install Prometheus Operator via Helm 3.2.1 + + + +## Setup Helm 3 + +### Install Helm 3 +``` +curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 +chmod +x get_helm.sh +./get_helm.sh +``` + +### Add Stable Charts +``` +helm repo add stable https://kubernetes-charts.storage.googleapis.com/ +``` + +## Setup Prometheus and Grafana via Helm + +### Install Prometheus Operator + +In my case, the Kubernetes cluster is behind a firewall. I am configuring the Granfana to be accessible via NodePort, as I need to access the Grafana UI using ssh tunnel. + +``` +kubectl create namespace prometheus-operator +helm install prometheus-operator stable/prometheus-operator -n prometheus-operator --set prometheusOperator.createCustomResource=false,grafana.service.type=NodePort +``` + +Note: Prometheus Operator (by default) installs Grafana and adds Prometheus as the data source. + +### Verify + +``` +kubectl get pods -n prometheus-operator +``` + +The above commands should show that all promtheus operator, prometheus, node exporter and grafana pods are running. + +``` +NAME READY STATUS RESTARTS AGE +alertmanager-prometheus-operator-alertmanager-0 2/2 Running 0 30m +prometheus-operator-grafana-cf6954699-5rcgl 2/2 Running 0 30m +prometheus-operator-kube-state-metrics-5fdcd78bc-sckjv 1/1 Running 0 30m +prometheus-operator-operator-5dd8f8f568-52qk8 2/2 Running 0 30m +prometheus-operator-prometheus-node-exporter-p8pm8 1/1 Running 0 30m +prometheus-operator-prometheus-node-exporter-trlhp 1/1 Running 0 30m +prometheus-operator-prometheus-node-exporter-wsm4n 1/1 Running 0 30m +prometheus-prometheus-operator-prometheus-0 3/3 Running 1 30m +``` + +``` +kubectl get svc -n prometheus-operator +``` + +Note that Grafana alone is running on NodePort + +``` +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +alertmanager-operated ClusterIP None 9093/TCP,9094/TCP,9094/UDP 31m +prometheus-operated ClusterIP None 9090/TCP 30m +prometheus-operator-alertmanager ClusterIP 10.102.104.48 9093/TCP 31m +prometheus-operator-grafana NodePort 10.96.160.172 80:31409/TCP 31m +prometheus-operator-kube-state-metrics ClusterIP 10.105.92.154 8080/TCP 31m +prometheus-operator-operator ClusterIP 10.99.15.245 8080/TCP,443/TCP 31m +prometheus-operator-prometheus ClusterIP 10.109.75.138 9090/TCP 31m +prometheus-operator-prometheus-node-exporter ClusterIP 10.98.128.115 9100/TCP 31m +``` + +## Accessing Grafana UI over SSH Tunnel + +### Windows using PuTTY + +- Get the Kubernetes Worker Node IP and the Grafana Node Port. +- Get the SSH server using which, Kubernetes Worker Node IP is accessible. Say this is Landing IP. +- Configure the PuTTY as follows: + - Create a new Session with Landing IP, Landing Port + - Create a Connection -> SSH -> Tunnels + - Source Port = Grafana NodePort + - Destination = Kubernetes Worker Node IP:Grafana Node Port + - Open the PuTTY session. Enter SSH user name and passowrd for the Landing IP. +- Now you can access Grafana UI at http://localhost:/. Default login and password ( admin/prom-operator ) + + +### Linux using SSH + +- Get the Kubernetes Worker Node IP and the Grafana Node Port. +- Get the SSH server using which, Kubernetes Worker Node IP is accessible. Say this is Landing IP. +- Open SSH tunnel using command. + ``` + ssh -NL :: @ -p + ``` +- Now you can access Grafana UI at http://localhost:/. Default login and password ( admin/prom-operator ) + +## Verify Granafa Dashboard + +- Login to Granfa UI +- Click on Settings -> Data Source. You must see a Default Prometheus data source for `http://prometheus-operator-prometheus:9090/` +- Click on Dashboards -> Manage Dashboards. You must see a list of dashboards. Click on any of them like: `kubernetes-compute-resources-cluster` + +## Add ZFS Grafana Dashboard + +- Login to Granfa UI +- Click on Create Dashboard -> Import dashboard +- Paste the below json and Click on Load + +https://raw.githubusercontent.com/openebs/zfs-localpv/master/deploy/sample/grafana-dashboard.json + +- Select datasource as Prometheus and Import it. + +- Now you should see a Dashboard with name as "ZFS-LocalPV" + +This dashboard exposes below metrics + +- ARC Size, Hits, Misses +- L2ARC Size, Hits, Misses +- ZPOOL Read/Write IOs +- ZPOOL Read/Write time +- Volume Stats (Used space percentage) + +The Volume Stats will look like this :- + +![Grafana](https://github.com/openebs/zfs-localpv/blob/master/deploy/sample/vol-stats.png) + +## References: +- https://helm.sh/docs/intro/install/ +- https://github.com/helm/charts/issues/19452 +- https://www.linode.com/docs/networking/ssh/using-ssh-on-windows/#ssh-tunneling-port-forwarding +- https://github.com/helm/charts/tree/master/stable/prometheus-operator +- https://github.com/helm/charts/tree/master/stable/grafana#configuration