From 5c6587216b33222055e53cb6e33a94bd399abaa2 Mon Sep 17 00:00:00 2001 From: Evan Benshetler Date: Fri, 15 May 2026 11:50:53 +0200 Subject: [PATCH 1/2] ROX-34665: Add Scans per Day by Namespace panel to cluster overview dashboard Add table panel showing daily scan counts broken down by namespace to rhacs-cluster-overview dashboard, placed after Scanner Overview Table. Uses increase(rox_central_scan_duration_count[1d]) with matrix transform to display dates as columns. --- .../dashboards/rhacs-cluster-overview.yaml | 191 ++++++++++++++++-- .../sources/.claude/settings.local.json | 12 ++ .../sources/rhacs-cluster-overview.json | 191 ++++++++++++++++-- 3 files changed, 366 insertions(+), 28 deletions(-) create mode 100644 resources/grafana/sources/.claude/settings.local.json diff --git a/resources/grafana/generated/dashboards/rhacs-cluster-overview.yaml b/resources/grafana/generated/dashboards/rhacs-cluster-overview.yaml index 5eec7ba..64b75a4 100644 --- a/resources/grafana/generated/dashboards/rhacs-cluster-overview.yaml +++ b/resources/grafana/generated/dashboards/rhacs-cluster-overview.yaml @@ -1474,7 +1474,9 @@ spec: "countRows": false, "enablePagination": true, "fields": "", - "reducer": ["sum"], + "reducer": [ + "sum" + ], "show": false }, "showHeader": true, @@ -1941,7 +1943,9 @@ spec: "countRows": false, "enablePagination": true, "fields": "", - "reducer": ["sum"], + "reducer": [ + "sum" + ], "show": false }, "showHeader": true, @@ -2131,13 +2135,152 @@ spec: ], "type": "table" }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "color": { + "mode": "thresholds" + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "namespace\\namespace" + }, + "properties": [ + { + "id": "custom.width", + "value": 236 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "namespace\\Time" + }, + "properties": [ + { + "id": "custom.width", + "value": 232 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "2026-05-08" + }, + "properties": [ + { + "id": "custom.width", + "value": 122 + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 85 + }, + "id": 150, + "interval": "1d", + "maxDataPoints": 30, + "options": { + "showHeader": true, + "cellHeight": "sm", + "footer": { + "show": false, + "reducer": [ + "sum" + ], + "countRows": false, + "fields": "" + }, + "sortBy": [ + { + "displayName": "namespace\\Time", + "desc": true + } + ] + }, + "pluginVersion": "11.1.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum by (namespace) (increase(rox_central_scan_duration_count[1d]))", + "format": "table", + "instant": false, + "interval": "", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "timeFrom": "$_relativeTime/d", + "timeShift": "$_timeShift/d", + "title": "Scans per Day by Namespace", + "transformations": [ + { + "id": "formatTime", + "options": { + "outputFormat": "YYYY-MM-DD", + "timeField": "Time", + "useTimezone": true + } + }, + { + "id": "groupingToMatrix", + "options": { + "columnField": "Time", + "rowField": "namespace", + "valueField": "Value" + } + } + ], + "type": "table" + }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 85 + "y": 93 }, "id": 149, "panels": [], @@ -2184,7 +2327,7 @@ spec: "h": 13, "w": 24, "x": 0, - "y": 86 + "y": 94 }, "id": 148, "options": { @@ -2193,7 +2336,9 @@ spec: "countRows": false, "enablePagination": true, "fields": "", - "reducer": ["sum"], + "reducer": [ + "sum" + ], "show": false }, "showHeader": true, @@ -2326,7 +2471,9 @@ spec: "options": { "fields": { "Expiration": { - "aggregations": ["last"], + "aggregations": [ + "last" + ], "operation": "aggregate" }, "Key": { @@ -2334,7 +2481,9 @@ spec: "operation": "groupby" }, "Namespace": { - "aggregations": ["last"], + "aggregations": [ + "last" + ], "operation": "groupby" }, "Secret": { @@ -2373,14 +2522,20 @@ spec: ], "revision": 1, "schemaVersion": 39, - "tags": ["rhacs"], + "tags": [ + "rhacs" + ], "templating": { "list": [ { "current": { "selected": true, - "text": ["All"], - "value": ["$__all"] + "text": [ + "All" + ], + "value": [ + "$__all" + ] }, "datasource": { "type": "prometheus", @@ -2407,8 +2562,12 @@ spec: { "current": { "selected": true, - "text": ["All"], - "value": ["$__all"] + "text": [ + "All" + ], + "value": [ + "$__all" + ] }, "datasource": { "type": "prometheus", @@ -2435,8 +2594,12 @@ spec: { "current": { "selected": true, - "text": ["All"], - "value": ["$__all"] + "text": [ + "All" + ], + "value": [ + "$__all" + ] }, "datasource": { "type": "prometheus", diff --git a/resources/grafana/sources/.claude/settings.local.json b/resources/grafana/sources/.claude/settings.local.json new file mode 100644 index 0000000..0b8977e --- /dev/null +++ b/resources/grafana/sources/.claude/settings.local.json @@ -0,0 +1,12 @@ +{ + "permissions": { + "allow": [ + "Read(//home/ebenshet/workspaces/rox-34665-grafana-display-scans-per-day/github.com/stackrox/rhacs-observability-resources/**)", + "Bash(jj status *)", + "Bash(jj rebase *)", + "Bash(rm -f resources/grafana/generated/dashboards/new-panel.yaml resources/grafana/sources/.claude/settings.local.json)", + "Bash(rmdir resources/grafana/sources/.claude)", + "Bash(jj commit -m 'ROX-34665: Add Scans per Day by Namespace panel to cluster overview dashboard *)" + ] + } +} diff --git a/resources/grafana/sources/rhacs-cluster-overview.json b/resources/grafana/sources/rhacs-cluster-overview.json index e32f518..d7dc3a6 100644 --- a/resources/grafana/sources/rhacs-cluster-overview.json +++ b/resources/grafana/sources/rhacs-cluster-overview.json @@ -1462,7 +1462,9 @@ "countRows": false, "enablePagination": true, "fields": "", - "reducer": ["sum"], + "reducer": [ + "sum" + ], "show": false }, "showHeader": true, @@ -1929,7 +1931,9 @@ "countRows": false, "enablePagination": true, "fields": "", - "reducer": ["sum"], + "reducer": [ + "sum" + ], "show": false }, "showHeader": true, @@ -2119,13 +2123,152 @@ ], "type": "table" }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "color": { + "mode": "thresholds" + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "namespace\\namespace" + }, + "properties": [ + { + "id": "custom.width", + "value": 236 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "namespace\\Time" + }, + "properties": [ + { + "id": "custom.width", + "value": 232 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "2026-05-08" + }, + "properties": [ + { + "id": "custom.width", + "value": 122 + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 85 + }, + "id": 150, + "interval": "1d", + "maxDataPoints": 30, + "options": { + "showHeader": true, + "cellHeight": "sm", + "footer": { + "show": false, + "reducer": [ + "sum" + ], + "countRows": false, + "fields": "" + }, + "sortBy": [ + { + "displayName": "namespace\\Time", + "desc": true + } + ] + }, + "pluginVersion": "11.1.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum by (namespace) (increase(rox_central_scan_duration_count[1d]))", + "format": "table", + "instant": false, + "interval": "", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "timeFrom": "$_relativeTime/d", + "timeShift": "$_timeShift/d", + "title": "Scans per Day by Namespace", + "transformations": [ + { + "id": "formatTime", + "options": { + "outputFormat": "YYYY-MM-DD", + "timeField": "Time", + "useTimezone": true + } + }, + { + "id": "groupingToMatrix", + "options": { + "columnField": "Time", + "rowField": "namespace", + "valueField": "Value" + } + } + ], + "type": "table" + }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 85 + "y": 93 }, "id": 149, "panels": [], @@ -2172,7 +2315,7 @@ "h": 13, "w": 24, "x": 0, - "y": 86 + "y": 94 }, "id": 148, "options": { @@ -2181,7 +2324,9 @@ "countRows": false, "enablePagination": true, "fields": "", - "reducer": ["sum"], + "reducer": [ + "sum" + ], "show": false }, "showHeader": true, @@ -2314,7 +2459,9 @@ "options": { "fields": { "Expiration": { - "aggregations": ["last"], + "aggregations": [ + "last" + ], "operation": "aggregate" }, "Key": { @@ -2322,7 +2469,9 @@ "operation": "groupby" }, "Namespace": { - "aggregations": ["last"], + "aggregations": [ + "last" + ], "operation": "groupby" }, "Secret": { @@ -2361,14 +2510,20 @@ ], "revision": 1, "schemaVersion": 39, - "tags": ["rhacs"], + "tags": [ + "rhacs" + ], "templating": { "list": [ { "current": { "selected": true, - "text": ["All"], - "value": ["$__all"] + "text": [ + "All" + ], + "value": [ + "$__all" + ] }, "datasource": { "type": "prometheus", @@ -2395,8 +2550,12 @@ { "current": { "selected": true, - "text": ["All"], - "value": ["$__all"] + "text": [ + "All" + ], + "value": [ + "$__all" + ] }, "datasource": { "type": "prometheus", @@ -2423,8 +2582,12 @@ { "current": { "selected": true, - "text": ["All"], - "value": ["$__all"] + "text": [ + "All" + ], + "value": [ + "$__all" + ] }, "datasource": { "type": "prometheus", From c6969979ec092bd3ffc4831cef211ae7cf0ee957 Mon Sep 17 00:00:00 2001 From: Evan Benshetler Date: Mon, 18 May 2026 10:49:57 +0200 Subject: [PATCH 2/2] Lint --- .../dashboards/rhacs-cluster-overview.yaml | 52 +++++-------------- .../sources/rhacs-cluster-overview.json | 52 +++++-------------- 2 files changed, 26 insertions(+), 78 deletions(-) diff --git a/resources/grafana/generated/dashboards/rhacs-cluster-overview.yaml b/resources/grafana/generated/dashboards/rhacs-cluster-overview.yaml index 64b75a4..79ffc74 100644 --- a/resources/grafana/generated/dashboards/rhacs-cluster-overview.yaml +++ b/resources/grafana/generated/dashboards/rhacs-cluster-overview.yaml @@ -1474,9 +1474,7 @@ spec: "countRows": false, "enablePagination": true, "fields": "", - "reducer": [ - "sum" - ], + "reducer": ["sum"], "show": false }, "showHeader": true, @@ -1943,9 +1941,7 @@ spec: "countRows": false, "enablePagination": true, "fields": "", - "reducer": [ - "sum" - ], + "reducer": ["sum"], "show": false }, "showHeader": true, @@ -2220,9 +2216,7 @@ spec: "cellHeight": "sm", "footer": { "show": false, - "reducer": [ - "sum" - ], + "reducer": ["sum"], "countRows": false, "fields": "" }, @@ -2336,9 +2330,7 @@ spec: "countRows": false, "enablePagination": true, "fields": "", - "reducer": [ - "sum" - ], + "reducer": ["sum"], "show": false }, "showHeader": true, @@ -2471,9 +2463,7 @@ spec: "options": { "fields": { "Expiration": { - "aggregations": [ - "last" - ], + "aggregations": ["last"], "operation": "aggregate" }, "Key": { @@ -2481,9 +2471,7 @@ spec: "operation": "groupby" }, "Namespace": { - "aggregations": [ - "last" - ], + "aggregations": ["last"], "operation": "groupby" }, "Secret": { @@ -2522,20 +2510,14 @@ spec: ], "revision": 1, "schemaVersion": 39, - "tags": [ - "rhacs" - ], + "tags": ["rhacs"], "templating": { "list": [ { "current": { "selected": true, - "text": [ - "All" - ], - "value": [ - "$__all" - ] + "text": ["All"], + "value": ["$__all"] }, "datasource": { "type": "prometheus", @@ -2562,12 +2544,8 @@ spec: { "current": { "selected": true, - "text": [ - "All" - ], - "value": [ - "$__all" - ] + "text": ["All"], + "value": ["$__all"] }, "datasource": { "type": "prometheus", @@ -2594,12 +2572,8 @@ spec: { "current": { "selected": true, - "text": [ - "All" - ], - "value": [ - "$__all" - ] + "text": ["All"], + "value": ["$__all"] }, "datasource": { "type": "prometheus", diff --git a/resources/grafana/sources/rhacs-cluster-overview.json b/resources/grafana/sources/rhacs-cluster-overview.json index d7dc3a6..03aa681 100644 --- a/resources/grafana/sources/rhacs-cluster-overview.json +++ b/resources/grafana/sources/rhacs-cluster-overview.json @@ -1462,9 +1462,7 @@ "countRows": false, "enablePagination": true, "fields": "", - "reducer": [ - "sum" - ], + "reducer": ["sum"], "show": false }, "showHeader": true, @@ -1931,9 +1929,7 @@ "countRows": false, "enablePagination": true, "fields": "", - "reducer": [ - "sum" - ], + "reducer": ["sum"], "show": false }, "showHeader": true, @@ -2208,9 +2204,7 @@ "cellHeight": "sm", "footer": { "show": false, - "reducer": [ - "sum" - ], + "reducer": ["sum"], "countRows": false, "fields": "" }, @@ -2324,9 +2318,7 @@ "countRows": false, "enablePagination": true, "fields": "", - "reducer": [ - "sum" - ], + "reducer": ["sum"], "show": false }, "showHeader": true, @@ -2459,9 +2451,7 @@ "options": { "fields": { "Expiration": { - "aggregations": [ - "last" - ], + "aggregations": ["last"], "operation": "aggregate" }, "Key": { @@ -2469,9 +2459,7 @@ "operation": "groupby" }, "Namespace": { - "aggregations": [ - "last" - ], + "aggregations": ["last"], "operation": "groupby" }, "Secret": { @@ -2510,20 +2498,14 @@ ], "revision": 1, "schemaVersion": 39, - "tags": [ - "rhacs" - ], + "tags": ["rhacs"], "templating": { "list": [ { "current": { "selected": true, - "text": [ - "All" - ], - "value": [ - "$__all" - ] + "text": ["All"], + "value": ["$__all"] }, "datasource": { "type": "prometheus", @@ -2550,12 +2532,8 @@ { "current": { "selected": true, - "text": [ - "All" - ], - "value": [ - "$__all" - ] + "text": ["All"], + "value": ["$__all"] }, "datasource": { "type": "prometheus", @@ -2582,12 +2560,8 @@ { "current": { "selected": true, - "text": [ - "All" - ], - "value": [ - "$__all" - ] + "text": ["All"], + "value": ["$__all"] }, "datasource": { "type": "prometheus",