From 35ab94dd13e1c396843ef9891b3386252ea9bd77 Mon Sep 17 00:00:00 2001 From: Christian Bianchi Date: Thu, 26 Oct 2023 15:47:31 +0200 Subject: [PATCH] Fix k8s resources & events dashboard (#396) * Fix k8s resources & events dashboard * Update CHANGELOG.md * Update etcd-k8s-events-and-resources-count.json --- CHANGELOG.md | 4 + .../etcd-k8s-events-and-resources-count.json | 707 +++++++----------- 2 files changed, 266 insertions(+), 445 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 734ab1f5..a96ccd80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Fix `Kubernetes Events & Resources Count` dashboard. + ## [3.2.2] - 2023-10-20 ### Changed diff --git a/helm/dashboards/charts/private_dashboards_al/dashboards/shared/private/etcd-k8s-events-and-resources-count.json b/helm/dashboards/charts/private_dashboards_al/dashboards/shared/private/etcd-k8s-events-and-resources-count.json index 3c2ad716..c0d79548 100644 --- a/helm/dashboards/charts/private_dashboards_al/dashboards/shared/private/etcd-k8s-events-and-resources-count.json +++ b/helm/dashboards/charts/private_dashboards_al/dashboards/shared/private/etcd-k8s-events-and-resources-count.json @@ -3,7 +3,10 @@ "list": [ { "builtIn": 1, - "datasource": "-- Grafana --", + "datasource": { + "type": "datasource", + "uid": "grafana" + }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", @@ -21,34 +24,35 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 38, - "iteration": 1653305303467, "links": [], "liveNow": false, "panels": [ { + "collapsed": false, "gridPos": { - "h": 2, + "h": 1, "w": 24, "x": 0, "y": 0 }, - "id": 5, - "options": { - "content": "Install the [etcd-kubernetes-resources-count-exporter](https://github.com/giantswarm/etcd-kubernetes-resources-count-exporter) app from the Playground catalog.", - "mode": "markdown" - }, - "pluginVersion": "8.4.2", - "title": "How to get the charts filled with data.", - "type": "text" + "id": 20, + "panels": [], + "title": "Resources", + "type": "row" }, { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, @@ -94,17 +98,18 @@ "overrides": [] }, "gridPos": { - "h": 8, + "h": 14, "w": 12, "x": 0, - "y": 2 + "y": 1 }, - "id": 14, + "id": 2, "options": { "legend": { "calcs": [], - "displayMode": "list", - "placement": "bottom" + "displayMode": "table", + "placement": "right", + "showLegend": true }, "tooltip": { "mode": "single", @@ -117,23 +122,58 @@ "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "exemplar": false, - "expr": "rate(etcd_kubernetes_events_count{cluster_id=\"$cluster\"}[5m])[24h:1m]", - "instant": true, + "editorMode": "code", + "exemplar": true, + "expr": "sum (etcd_kubernetes_resources_count{cluster_id=\"$cluster\", namespace=~\"$namespace\"}) by (kind)", + "instant": false, "interval": "", - "intervalFactor": 1, - "legendFormat": "{{namespace}} - {{kind}} - {{ reason}}", + "legendFormat": "{{kind}}", "refId": "A" } ], - "title": "$cluster - Rate of Events every 5m in 1m buckets", + "title": "$cluster - Kubernetes objects by Kind", "type": "timeseries" }, { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "", "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": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } }, "mappings": [], "thresholds": { @@ -144,214 +184,74 @@ "value": null }, { - "color": "#EAB839", - "value": "" + "color": "red", + "value": 80 } ] } }, - "overrides": [ - { - "matcher": { - "id": "byType", - "options": "number" - }, - "properties": [ - { - "id": "unit", - "value": "short" - } - ] - } - ] + "overrides": [] }, "gridPos": { - "h": 8, + "h": 14, "w": 12, "x": 12, - "y": 2 + "y": 1 }, - "id": 12, + "id": 6, "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true }, - "text": {}, - "textMode": "auto" + "tooltip": { + "mode": "single", + "sort": "none" + } }, - "pluginVersion": "8.4.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "exemplar": false, - "expr": "sum(sum_over_time(rate(etcd_kubernetes_events_count{cluster_id=\"$cluster\"}[1m])[$__range:1m]))", - "instant": true, + "editorMode": "code", + "exemplar": true, + "expr": "sum (etcd_kubernetes_resources_count{cluster_id=\"$cluster\", namespace=~\"$namespace\"}) by (namespace)", "interval": "", - "legendFormat": "", + "legendFormat": "{{namespace}}", + "range": true, "refId": "A" } ], - "title": "$cluster - Total Number of Events", - "type": "stat" + "title": "$cluster - Kubernetes objects by Namespace", + "type": "timeseries" }, { - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "auto", - "displayMode": "auto" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Value (sum)" - }, - "properties": [ - { - "id": "custom.displayMode", - "value": "basic" - } - ] - } - ] - }, + "collapsed": false, "gridPos": { - "h": 8, - "w": 12, + "h": 1, + "w": 24, "x": 0, - "y": 10 + "y": 15 }, - "id": 16, - "options": { - "footer": { - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true - }, - "pluginVersion": "8.4.2", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": false, - "expr": "rate(etcd_kubernetes_events_count{cluster_id=\"$cluster\"}[1m])[$__range:1m]", - "format": "table", - "instant": true, - "interval": "", - "legendFormat": "", - "refId": "A" - } - ], - "title": "$cluster - Total number of events every minute grouped by Kind of the involved object", - "transformations": [ - { - "id": "seriesToRows", - "options": {} - }, - { - "id": "groupBy", - "options": { - "fields": { - "Time": { - "aggregations": [] - }, - "Value": { - "aggregations": [ - "sum" - ], - "operation": "aggregate" - }, - "installation": { - "aggregations": [] - }, - "kind": { - "aggregations": [], - "operation": "groupby" - }, - "namespace": { - "aggregations": [] - }, - "objectNamespace": { - "aggregations": [] - }, - "reason": { - "aggregations": [] - }, - "source": { - "aggregations": [] - } - } - } - }, - { - "disabled": true, - "id": "concatenate", - "options": { - "frameNameLabel": "frame", - "frameNameMode": "label" - } - }, - { - "id": "sortBy", - "options": { - "fields": {}, - "sort": [ - { - "desc": true, - "field": "Value (sum)" - } - ] - } - } - ], - "type": "table" + "id": 19, + "panels": [], + "title": "Events", + "type": "row" }, { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, - "custom": { - "align": "auto", - "displayMode": "auto" - }, "mappings": [], "thresholds": { "mode": "absolute", @@ -361,8 +261,8 @@ "value": null }, { - "color": "red", - "value": 80 + "color": "#EAB839", + "value": "" } ] } @@ -370,17 +270,13 @@ "overrides": [ { "matcher": { - "id": "byName", - "options": "Value (sum)" + "id": "byType", + "options": "number" }, "properties": [ { - "id": "custom.displayMode", - "value": "auto" - }, - { - "id": "custom.displayMode", - "value": "basic" + "id": "unit", + "value": "short" } ] } @@ -389,109 +285,83 @@ "gridPos": { "h": 8, "w": 12, - "x": 12, - "y": 10 + "x": 0, + "y": 16 }, - "id": 15, + "id": 12, "options": { - "footer": { - "fields": "", - "reducer": [ - "sum" + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" ], - "show": false + "fields": "", + "values": false }, - "showHeader": true + "text": {}, + "textMode": "auto" }, - "pluginVersion": "8.4.2", + "pluginVersion": "10.0.3", "targets": [ { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, + "editorMode": "code", "exemplar": false, - "expr": "rate(etcd_kubernetes_events_count{cluster_id=\"$cluster\"}[1m])[$__range:1m]", - "format": "table", + "expr": "sum(etcd_kubernetes_resources_count{cluster_id=\"$cluster\", kind=\"events\",namespace=~\"$namespace\"})", "instant": true, "interval": "", "legendFormat": "", "refId": "A" } ], - "title": "$cluster - Total number of events every minute grouped by the reporting component", - "transformations": [ - { - "id": "seriesToRows", - "options": {} - }, - { - "id": "groupBy", - "options": { - "fields": { - "Time": { - "aggregations": [] - }, - "Value": { - "aggregations": [ - "sum" - ], - "operation": "aggregate" - }, - "installation": { - "aggregations": [] - }, - "kind": { - "aggregations": [] - }, - "namespace": { - "aggregations": [] - }, - "objectNamespace": { - "aggregations": [] - }, - "reason": { - "aggregations": [] - }, - "source": { - "aggregations": [], - "operation": "groupby" - } - } - } - }, - { - "disabled": true, - "id": "concatenate", - "options": { - "frameNameLabel": "frame", - "frameNameMode": "label" - } - }, - { - "id": "sortBy", - "options": { - "fields": {}, - "sort": [ - { - "desc": true, - "field": "Value (sum)" - } - ] - } - } - ], - "type": "table" + "title": "$cluster - Current Number of Events", + "type": "stat" }, { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "fieldConfig": { "defaults": { "color": { - "mode": "thresholds" + "mode": "palette-classic" }, "custom": { - "align": "auto", - "displayMode": "auto" + "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": { @@ -511,113 +381,55 @@ "overrides": [] }, "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 18 + "h": 8, + "w": 12, + "x": 12, + "y": 16 }, - "id": 10, + "id": 14, "options": { - "footer": { - "fields": "", - "reducer": [ - "sum" - ], - "show": false + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "showHeader": true + "tooltip": { + "mode": "single", + "sort": "none" + } }, - "pluginVersion": "8.4.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "exemplar": false, - "expr": "rate(etcd_kubernetes_events_count{cluster_id=\"$cluster\"}[1m])[$__range:1m]", - "format": "table", - "instant": true, - "interval": "", - "legendFormat": "", - "refId": "A" - } - ], - "title": "$cluster - Table of events", - "transformations": [ - { - "id": "seriesToRows", - "options": {} - }, - { - "id": "groupBy", - "options": { - "fields": { - "Time": { - "aggregations": [] - }, - "Value": { - "aggregations": [ - "sum" - ], - "operation": "aggregate" - }, - "installation": { - "aggregations": [] - }, - "kind": { - "aggregations": [], - "operation": "groupby" - }, - "namespace": { - "aggregations": [], - "operation": "groupby" - }, - "objectNamespace": { - "aggregations": [], - "operation": "groupby" - }, - "reason": { - "aggregations": [], - "operation": "groupby" - }, - "source": { - "aggregations": [], - "operation": "groupby" - } - } - } - }, - { - "disabled": true, - "id": "concatenate", - "options": { - "frameNameLabel": "frame", - "frameNameMode": "label" - } - }, - { - "id": "sortBy", - "options": { - "fields": {}, - "sort": [ - { - "desc": true, - "field": "Value (sum)" - } - ] - } + "editorMode": "code", + "expr": "sum(rate(etcd_kubernetes_events_count{cluster_id=\"$cluster\", namespace=~\"$namespace\"}[1h])) by (namespace)", + "hide": false, + "instant": false, + "legendFormat": "{{namespace}}", + "range": true, + "refId": "B" } ], - "type": "table" + "title": "$cluster - Rate of Events every 5m in 1m buckets", + "type": "timeseries" }, { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, @@ -663,46 +475,57 @@ "overrides": [] }, "gridPos": { - "h": 9, - "w": 24, + "h": 12, + "w": 8, "x": 0, - "y": 25 + "y": 24 }, - "id": 8, + "id": 16, "options": { "legend": { "calcs": [], - "displayMode": "list", - "placement": "bottom" + "displayMode": "table", + "placement": "right", + "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, + "pluginVersion": "10.0.3", "targets": [ { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "exemplar": true, - "expr": "rate(etcd_kubernetes_events_count{cluster_id=\"$cluster\"}[1m])", - "interval": "", - "legendFormat": "{{namespace}} - {{kind}} - {{reason}} in object namespace {{objectNamespace}}", - "refId": "A" + "editorMode": "code", + "expr": "sum(etcd_kubernetes_events_count{cluster_id=\"$cluster\",namespace=~\"$namespace\"}) by (kind)", + "hide": false, + "instant": false, + "legendFormat": "{{kind}}", + "range": true, + "refId": "B" } ], - "title": "$cluster - Events Counted every minute", + "title": "$cluster - Events by Kind of the involved object", + "transformations": [], "type": "timeseries" }, { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, @@ -748,48 +571,57 @@ "overrides": [] }, "gridPos": { - "h": 17, - "w": 24, - "x": 0, - "y": 34 + "h": 12, + "w": 8, + "x": 8, + "y": 24 }, - "id": 2, + "id": 18, "options": { "legend": { "calcs": [], "displayMode": "table", - "placement": "right" + "placement": "right", + "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, + "pluginVersion": "10.0.3", "targets": [ { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "exemplar": true, - "expr": "sum (etcd_kubernetes_resources_count{cluster_id=\"$cluster\", namespace=~\"$namespace\", kind=~\"$kind\"}) by (kind)", + "editorMode": "code", + "expr": "sum(etcd_kubernetes_events_count{cluster_id=\"$cluster\",namespace=~\"$namespace\"}) by (reason)", + "hide": false, "instant": false, - "interval": "", - "legendFormat": "{{kind}}", - "refId": "A" + "legendFormat": "{{reason}}", + "range": true, + "refId": "B" } ], - "title": "$cluster - Kubernetes objects by Kind", + "title": "$cluster - Events by reason", + "transformations": [], "type": "timeseries" }, { - "description": "", + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, @@ -835,42 +667,47 @@ "overrides": [] }, "gridPos": { - "h": 15, - "w": 24, - "x": 0, - "y": 51 + "h": 12, + "w": 8, + "x": 16, + "y": 24 }, - "id": 6, + "id": 15, "options": { "legend": { "calcs": [], "displayMode": "table", - "placement": "right" + "placement": "right", + "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, + "pluginVersion": "10.0.3", "targets": [ { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "exemplar": true, - "expr": "sum (etcd_kubernetes_resources_count{cluster_id=\"$cluster\", namespace=~\"$namespace\", kind=~\"$kind\"}) by (namespace)", - "interval": "", + "editorMode": "code", + "expr": "sum(etcd_kubernetes_events_count{cluster_id=\"$cluster\",namespace=~\"$namespace\"}) by (namespace)", + "hide": false, + "instant": false, "legendFormat": "{{namespace}}", - "refId": "A" + "range": true, + "refId": "B" } ], - "title": "$cluster - Kubernetes objects by Namespace", + "title": "$cluster - Events by namespace", + "transformations": [], "type": "timeseries" } ], - "refresh": false, - "schemaVersion": 35, + "refresh": "", + "schemaVersion": 38, "style": "dark", "tags": [ "owner:team-phoenix" @@ -880,8 +717,12 @@ { "current": { "selected": true, - "text": "deu01", - "value": "deu01" + "text": "gaia", + "value": "gaia" + }, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" }, "definition": "label_values(etcd_kubernetes_resources_count, cluster_id)", "hide": 0, @@ -903,7 +744,7 @@ { "allValue": ".*", "current": { - "selected": false, + "selected": true, "text": [ "All" ], @@ -911,6 +752,10 @@ "$__all" ] }, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, "definition": "label_values(etcd_kubernetes_resources_count, namespace)", "hide": 0, "includeAll": true, @@ -927,45 +772,17 @@ "skipUrlSync": false, "sort": 0, "type": "query" - }, - { - "allValue": ".*", - "current": { - "selected": false, - "text": [ - "All" - ], - "value": [ - "$__all" - ] - }, - "definition": "label_values(etcd_kubernetes_resources_count, kind)", - "hide": 0, - "includeAll": true, - "label": "Kind", - "multi": true, - "name": "kind", - "options": [], - "query": { - "query": "label_values(etcd_kubernetes_resources_count, kind)", - "refId": "StandardVariableQuery" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "type": "query" } ] }, "time": { - "from": "now-3h", + "from": "now-5m", "to": "now" }, "timepicker": {}, "timezone": "", "title": "Kubernetes Events & Resources Count", "uid": "4FZgOJtnk", - "version": 2, + "version": 1, "weekStart": "" -}e +}