From 9152aeea2429f1fda98486b5e304cd457b27badf Mon Sep 17 00:00:00 2001 From: ilham-cloudless Date: Wed, 28 May 2025 16:50:13 +0400 Subject: [PATCH 1/2] feat: adding lightmare grafana dashboard --- .../lightmare/dashboards/lightmare.json | 827 ++++++++++++++++++ .../configs/lightmare/kustomization.yml | 11 +- 2 files changed, 832 insertions(+), 6 deletions(-) create mode 100644 flux/components/monitoring/configs/lightmare/dashboards/lightmare.json diff --git a/flux/components/monitoring/configs/lightmare/dashboards/lightmare.json b/flux/components/monitoring/configs/lightmare/dashboards/lightmare.json new file mode 100644 index 00000000..c9bef2d9 --- /dev/null +++ b/flux/components/monitoring/configs/lightmare/dashboards/lightmare.json @@ -0,0 +1,827 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 15, + "links": [], + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 3, + "x": 0, + "y": 0 + }, + "id": 4, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "count(kubevirt_vm_info)", + "hide": false, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "B" + } + ], + "title": "Total VMs", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 3, + "x": 3, + "y": 0 + }, + "id": 1, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "sum(kubevirt_vmi_node_cpu_affinity)", + "hide": false, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "B" + } + ], + "title": "CPU Cores in use", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 3, + "x": 6, + "y": 0 + }, + "id": 3, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "sum(kubevirt_vmi_memory_domain_bytes) ", + "hide": false, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "B" + } + ], + "title": "RAM in use", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 15, + "x": 9, + "y": 0 + }, + "id": 5, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "sum(ccp_checked_hashes_count)", + "hide": false, + "instant": false, + "legendFormat": "Hashrate", + "range": true, + "refId": "B" + } + ], + "title": "CCP Hashrate", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "name" + }, + "properties": [ + { + "id": "custom.width", + "value": 644 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "VM" + }, + "properties": [ + { + "id": "custom.width", + "value": 152 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "exported_namespace" + }, + "properties": [ + { + "id": "custom.width", + "value": 385 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "CPU Cores" + }, + "properties": [ + { + "id": "custom.width", + "value": 82 + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 5 + }, + "id": 2, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "kubevirt_vm_info", + "format": "table", + "hide": false, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "kubevirt_vmi_node_cpu_affinity", + "format": "table", + "hide": false, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "kubevirt_vmi_memory_domain_bytes / (1024 * 1024)", + "format": "table", + "hide": false, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "C" + } + ], + "title": "VM Info", + "transformations": [ + { + "id": "joinByField", + "options": { + "byField": "name", + "mode": "outer" + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Time 1": true, + "Time 2": true, + "Time 3": true, + "Value #A": true, + "__name__ 1": true, + "__name__ 2": true, + "__name__ 3": true, + "container 1": true, + "container 2": true, + "container 3": true, + "endpoint 1": true, + "endpoint 2": true, + "endpoint 3": true, + "exported_namespace 2": true, + "exported_namespace 3": true, + "flavor": true, + "instance 1": true, + "instance 2": true, + "instance 3": true, + "instance_type": true, + "job 1": true, + "job 2": true, + "job 3": true, + "kubernetes_vmi_label_app 1": true, + "kubernetes_vmi_label_app 2": true, + "kubernetes_vmi_label_fluence 1": true, + "kubernetes_vmi_label_fluence 2": true, + "kubernetes_vmi_label_kubevirt_io_nodeName 1": false, + "kubernetes_vmi_label_kubevirt_io_nodeName 2": true, + "kubernetes_vmi_label_worker_id 1": true, + "kubernetes_vmi_label_worker_id 2": true, + "kubernetes_vmi_label_worker_kind 1": true, + "kubernetes_vmi_label_worker_kind 2": true, + "machine_type": true, + "name": false, + "namespace 1": true, + "namespace 2": true, + "namespace 3": true, + "node 1": true, + "node 2": true, + "os": true, + "pod 1": true, + "pod 2": true, + "pod 3": true, + "preference": true, + "service 1": true, + "service 2": true, + "service 3": true, + "status": false, + "status_group": true, + "workload": true + }, + "includeByName": {}, + "indexByName": {}, + "renameByName": { + "Time 1": "", + "Value #B": "CPU Cores", + "Value #C": "RAM", + "exported_namespace 1": "Deal", + "kubernetes_vmi_label_kubevirt_io_nodeName 1": "Node", + "name": "VM", + "status": "Status" + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": 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 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 13 + }, + "id": 8, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "avg by (name,exported_namespace)(rate(kubevirt_vmi_vcpu_seconds_total[1m]))", + "hide": false, + "instant": false, + "legendFormat": "{{exported_namespace}}", + "range": true, + "refId": "B" + } + ], + "title": "CPU usage", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": 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" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "binBps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 21 + }, + "id": 6, + "options": { + "legend": { + "calcs": [ + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "rate(kubevirt_vmi_network_receive_bytes_total[1m])", + "instant": false, + "legendFormat": "{{exported_namespace}}", + "range": true, + "refId": "A" + } + ], + "title": "Network IO, receive", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": 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" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "binBps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 21 + }, + "id": 7, + "options": { + "legend": { + "calcs": [ + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "rate(kubevirt_vmi_network_transmit_bytes_total[1m])", + "instant": false, + "legendFormat": "{{exported_namespace}}", + "range": true, + "refId": "A" + } + ], + "title": "Network IO, transmit", + "type": "timeseries" + } + ], + "schemaVersion": 39, + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-3h", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "TMP-lightmare", + "uid": "dels27zi5of7kd", + "version": 3, + "weekStart": "" +} \ No newline at end of file diff --git a/flux/components/monitoring/configs/lightmare/kustomization.yml b/flux/components/monitoring/configs/lightmare/kustomization.yml index b9dec980..d4a9168a 100644 --- a/flux/components/monitoring/configs/lightmare/kustomization.yml +++ b/flux/components/monitoring/configs/lightmare/kustomization.yml @@ -10,10 +10,9 @@ generatorOptions: app.kubernetes.io/part-of: spectrum-monitoring app.kubernetes.io/component: lightmare commonAnnotations: - grafana_folder: "lightmare" + grafana_folder: "Lightmare" -# tbd -# configMapGenerator: -# - name: dashboards-k8s-lightmare -# files: -# - *.json +configMapGenerator: + - name: dashboards-lightmare + files: + - dashboards/lightmare.json From a1ee985abfbceef200165936ebbd9b0d09371491 Mon Sep 17 00:00:00 2001 From: Anatolios Laskaris Date: Wed, 28 May 2025 15:57:13 +0300 Subject: [PATCH 2/2] Rename dashboard --- .../monitoring/configs/lightmare/dashboards/lightmare.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flux/components/monitoring/configs/lightmare/dashboards/lightmare.json b/flux/components/monitoring/configs/lightmare/dashboards/lightmare.json index c9bef2d9..39ef1b3c 100644 --- a/flux/components/monitoring/configs/lightmare/dashboards/lightmare.json +++ b/flux/components/monitoring/configs/lightmare/dashboards/lightmare.json @@ -820,8 +820,8 @@ }, "timepicker": {}, "timezone": "browser", - "title": "TMP-lightmare", + "title": "Lightmare", "uid": "dels27zi5of7kd", "version": 3, "weekStart": "" -} \ No newline at end of file +}