From fd8e273c9bd8932c3ccff457bba2e7e7fd0abb8f Mon Sep 17 00:00:00 2001 From: beth Date: Tue, 28 Mar 2023 22:18:03 +0200 Subject: [PATCH] updated grafana dashboard --- monitoring/grafana/dashboards/main.json | 878 +++++++++++++++--------- monitoring/prometheus.yml | 5 - 2 files changed, 552 insertions(+), 331 deletions(-) diff --git a/monitoring/grafana/dashboards/main.json b/monitoring/grafana/dashboards/main.json index a2d9d70..17e86e5 100644 --- a/monitoring/grafana/dashboards/main.json +++ b/monitoring/grafana/dashboards/main.json @@ -37,7 +37,37 @@ "fieldConfig": { "defaults": { "color": { - "mode": "thresholds" + "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": "stepBefore", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "dashed" + } }, "mappings": [], "thresholds": { @@ -47,19 +77,27 @@ "color": "green", "value": null }, - { - "color": "#EAB839", - "value": 50 - }, { "color": "red", - "value": 200 + "value": 10 } ] - }, - "unit": "ms" + } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "{instance=\"minitwit:2112\", job=\"minitwit\"}" + }, + "properties": [ + { + "id": "displayName", + "value": "Errors" + } + ] + } + ] }, "gridPos": { "h": 8, @@ -67,37 +105,34 @@ "x": 0, "y": 0 }, - "id": 13, + "id": 15, "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "textMode": "auto" + "tooltip": { + "mode": "single", + "sort": "none" + } }, - "pluginVersion": "9.4.3", "targets": [ { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "editorMode": "code", - "expr": " rate(minitwit_response_time_sum[1h])\n/\n rate(minitwit_response_time_count[1h])", + "editorMode": "builder", + "expr": "increase(minitwit_error_codes[24h])", "legendFormat": "__auto", "range": true, "refId": "A" } ], - "title": "Average Response Time", - "type": "stat" + "title": "Error per hour", + "type": "timeseries" }, { "datasource": { @@ -107,7 +142,40 @@ "fieldConfig": { "defaults": { "color": { - "mode": "thresholds" + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 4, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } }, "mappings": [], "thresholds": { @@ -118,11 +186,11 @@ "value": null }, { - "color": "red", - "value": 1000 + "color": "#EAB839", + "value": 1500 }, { - "color": "#EAB839", + "color": "red", "value": 10000 } ] @@ -139,20 +207,18 @@ }, "id": 11, "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "textMode": "auto" + "tooltip": { + "mode": "multi", + "sort": "none" + } }, - "pluginVersion": "9.4.3", + "pluginVersion": "9.4.7", "targets": [ { "datasource": { @@ -161,13 +227,13 @@ }, "editorMode": "builder", "expr": "increase(minitwit_number_of_tweets[1h])", - "legendFormat": "__auto", + "legendFormat": "{{label_name}}", "range": true, "refId": "A" } ], "title": "Tweets Per Hour", - "type": "stat" + "type": "timeseries" }, { "datasource": { @@ -193,7 +259,7 @@ "tooltip": false, "viz": false }, - "lineInterpolation": "stepBefore", + "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { @@ -206,10 +272,12 @@ "mode": "none" }, "thresholdsStyle": { - "mode": "dashed" + "mode": "off" } }, "mappings": [], + "max": 500, + "min": 0, "thresholds": { "mode": "absolute", "steps": [ @@ -217,27 +285,19 @@ "color": "green", "value": null }, + { + "color": "#EAB839", + "value": 50 + }, { "color": "red", - "value": 10 + "value": 200 } ] - } + }, + "unit": "ms" }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "{instance=\"minitwit:2112\", job=\"minitwit\"}" - }, - "properties": [ - { - "id": "displayName", - "value": "Errors" - } - ] - } - ] + "overrides": [] }, "gridPos": { "h": 8, @@ -245,7 +305,7 @@ "x": 0, "y": 8 }, - "id": 15, + "id": 13, "options": { "legend": { "calcs": [], @@ -258,143 +318,162 @@ "sort": "none" } }, + "pluginVersion": "9.4.7", "targets": [ { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "editorMode": "builder", - "expr": "increase(minitwit_error_codes[1h])", + "editorMode": "code", + "expr": " rate(minitwit_response_time_sum[5m])\n/\n rate(minitwit_response_time_count[5m])", "legendFormat": "__auto", "range": true, "refId": "A" } ], - "title": "Error per hour", + "title": "Average Response Time", "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { - "uid": "$datasource" + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] }, - "fill": 0, - "fillGradient": 0, "gridPos": { - "h": 7, - "w": 12, + "h": 8, + "w": 4, "x": 12, "y": 8 }, - "hiddenSeries": false, - "id": 3, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", + "id": 17, "options": { - "alertThreshold": true + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" }, - "percentage": false, "pluginVersion": "9.4.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, "targets": [ { "datasource": { - "uid": "$datasource" + "type": "prometheus", + "uid": "PBFA97CFB590B2093" }, - "expr": "node_load1{job=\"node\", instance=\"$instance\"}", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "1m load average", + "editorMode": "code", + "exemplar": false, + "expr": "rate(minitwit_response_time_sum[1m])\r\n/\r\nrate(minitwit_response_time_count[1m])", + "instant": true, + "legendFormat": "__auto", + "range": false, "refId": "A" - }, - { - "datasource": { - "uid": "$datasource" + } + ], + "title": "Response time [1 minute]", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" }, - "expr": "node_load5{job=\"node\", instance=\"$instance\"}", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "5m load average", - "refId": "B" - }, - { - "datasource": { - "uid": "$datasource" + "decimals": 1, + "mappings": [], + "max": 100, + "min": -1, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] }, - "expr": "node_load15{job=\"node\", instance=\"$instance\"}", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "15m load average", - "refId": "C" + "unit": "percent" }, - { - "datasource": { - "uid": "$datasource" - }, - "expr": "count(node_cpu_seconds_total{job=\"node\", instance=\"$instance\", mode=\"idle\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "logical cores", - "refId": "D" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Load Average", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" + "overrides": [] }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] + "gridPos": { + "h": 8, + "w": 4, + "x": 16, + "y": 8 }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "min": 0, - "show": true + "id": 19, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.4.3", + "targets": [ { - "format": "short", - "logBase": 1, - "min": 0, - "show": true + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "100 -\r\n(\r\n node_filesystem_free_bytes{device=\"/dev/vda1\"}\r\n/\r\n node_filesystem_size_bytes{device=\"/dev/vda1\"}\r\n* 100\r\n)", + "hide": false, + "legendFormat": "__auto", + "range": true, + "refId": "A" } ], - "yaxis": { - "align": false - } + "title": "Disk Usage", + "type": "gauge" }, { "datasource": { + "type": "prometheus", "uid": "$datasource" }, "fieldConfig": { @@ -437,10 +516,10 @@ "overrides": [] }, "gridPos": { - "h": 7, - "w": 6, - "x": 18, - "y": 15 + "h": 8, + "w": 4, + "x": 20, + "y": 8 }, "id": 5, "links": [], @@ -463,10 +542,12 @@ "datasource": { "uid": "$datasource" }, + "editorMode": "code", "expr": "100 -\n(\n avg(node_memory_MemAvailable_bytes{job=\"node\", instance=\"$instance\"})\n/\n avg(node_memory_MemTotal_bytes{job=\"node\", instance=\"$instance\"})\n* 100\n)\n", "format": "time_series", "intervalFactor": 2, "legendFormat": "", + "range": true, "refId": "A" } ], @@ -484,7 +565,7 @@ "fill": 1, "fillGradient": 0, "gridPos": { - "h": 7, + "h": 8, "w": 12, "x": 0, "y": 16 @@ -551,74 +632,234 @@ "logBase": 1, "max": 1, "min": 0, - "show": true + "show": true + }, + { + "format": "percentunit", + "logBase": 1, + "max": 1, + "min": 0, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fill": 0, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 16 + }, + "hiddenSeries": false, + "id": 3, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "9.4.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "node_load1{job=\"node\", instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "1m load average", + "refId": "A" + }, + { + "datasource": { + "uid": "$datasource" + }, + "expr": "node_load5{job=\"node\", instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "5m load average", + "refId": "B" + }, + { + "datasource": { + "uid": "$datasource" + }, + "expr": "node_load15{job=\"node\", instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "15m load average", + "refId": "C" + }, + { + "datasource": { + "uid": "$datasource" + }, + "expr": "count(node_cpu_seconds_total{job=\"node\", instance=\"$instance\", mode=\"idle\"})", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "logical cores", + "refId": "D" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Load Average", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "min": 0, + "show": true + }, + { + "format": "short", + "logBase": 1, + "min": 0, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" }, - { - "format": "percentunit", - "logBase": 1, - "max": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "uid": "$datasource" + "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { - "h": 7, - "w": 18, + "h": 8, + "w": 8, "x": 0, - "y": 23 + "y": 24 }, - "hiddenSeries": false, "id": 4, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, "links": [], - "nullPointMode": "null", "options": { - "alertThreshold": true + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } }, - "percentage": false, - "pluginVersion": "9.4.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, + "pluginVersion": "9.4.7", "targets": [ { "datasource": { "uid": "$datasource" }, + "editorMode": "code", "expr": "(\n node_memory_MemTotal_bytes{job=\"node\", instance=\"$instance\"}\n-\n node_memory_MemFree_bytes{job=\"node\", instance=\"$instance\"}\n-\n node_memory_Buffers_bytes{job=\"node\", instance=\"$instance\"}\n-\n node_memory_Cached_bytes{job=\"node\", instance=\"$instance\"}\n)\n", "format": "time_series", + "hide": false, "intervalFactor": 2, "legendFormat": "memory used", + "range": true, "refId": "A" }, { @@ -627,6 +868,7 @@ }, "expr": "node_memory_Buffers_bytes{job=\"node\", instance=\"$instance\"}", "format": "time_series", + "hide": false, "intervalFactor": 2, "legendFormat": "memory buffers", "refId": "B" @@ -637,6 +879,7 @@ }, "expr": "node_memory_Cached_bytes{job=\"node\", instance=\"$instance\"}", "format": "time_series", + "hide": false, "intervalFactor": 2, "legendFormat": "memory cached", "refId": "C" @@ -647,97 +890,106 @@ }, "expr": "node_memory_MemFree_bytes{job=\"node\", instance=\"$instance\"}", "format": "time_series", + "hide": false, "intervalFactor": 2, "legendFormat": "memory free", "refId": "D" } ], - "thresholds": [], - "timeRegions": [], "title": "Memory Usage", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "logBase": 1, - "min": 0, - "show": true - }, - { - "format": "bytes", - "logBase": 1, - "min": 0, - "show": true - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, "datasource": { "uid": "$datasource" }, - "fill": 0, - "fillGradient": 0, + "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": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/ io time/" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + } + ] + }, "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 30 + "h": 8, + "w": 8, + "x": 8, + "y": 24 }, - "hiddenSeries": false, "id": 6, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, "links": [], - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "9.4.3", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "/ read| written/", - "yaxis": 1 + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - { - "alias": "/ io time/", - "yaxis": 2 + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, + "pluginVersion": "9.4.7", "targets": [ { "datasource": { @@ -773,35 +1025,8 @@ "refId": "C" } ], - "thresholds": [], - "timeRegions": [], "title": "Disk I/O", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "logBase": 1, - "show": true - }, - { - "format": "s", - "logBase": 1, - "show": true - } - ], - "yaxis": { - "align": false - } + "type": "timeseries" }, { "aliasColors": {}, @@ -814,10 +1039,10 @@ "fill": 0, "fillGradient": 0, "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 30 + "h": 8, + "w": 4, + "x": 16, + "y": 24 }, "hiddenSeries": false, "id": 9, @@ -904,10 +1129,10 @@ "fill": 0, "fillGradient": 0, "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 37 + "h": 8, + "w": 4, + "x": 20, + "y": 24 }, "hiddenSeries": false, "id": 8, @@ -984,7 +1209,7 @@ } } ], - "refresh": "5s", + "refresh": "30s", "revision": 1, "schemaVersion": 38, "style": "dark", @@ -1003,6 +1228,7 @@ "name": "datasource", "options": [], "query": "prometheus", + "queryValue": "", "refresh": 1, "regex": "", "skipUrlSync": false, @@ -1071,6 +1297,6 @@ "timezone": "browser", "title": "Minitwit Dashboard", "uid": "6m9Cd4aVz", - "version": 4, + "version": 1, "weekStart": "" } \ No newline at end of file diff --git a/monitoring/prometheus.yml b/monitoring/prometheus.yml index bce433c..efdc214 100644 --- a/monitoring/prometheus.yml +++ b/monitoring/prometheus.yml @@ -10,11 +10,6 @@ global: # Here it's Prometheus itself. scrape_configs: # The job name is added as a label `job=` to any timeseries scraped from this config. - - job_name: "prometheus" - # Override the global default and scrape targets from this job every 5 seconds. - scrape_interval: 5s - static_configs: - - targets: ["localhost:9090"] - job_name: "minitwit" scrape_interval: 30s static_configs: