-
Notifications
You must be signed in to change notification settings - Fork 4
ROX-34665: Add Scans per Day by Namespace panel to cluster overview #340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -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 *)", | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
python - <<'PY'
import json
path = "resources/grafana/sources/.claude/settings.local.json"
with open(path, encoding="utf-8") as stream:
rules = json.load(stream)["permissions"]["allow"]
matches = [rule for rule in rules if rule.startswith("Bash(jj rebase")]
if not matches:
raise SystemExit("No jj rebase rule found")
for rule in matches:
print(rule)
if rule == "Bash(jj rebase *)":
raise SystemExit("Unscoped jj rebase permission found")
PYRepository: stackrox/rhacs-observability-resources Length of output: 230 🌐 Web query:
💡 Result: In Claude Code, Bash permission rules support glob pattern matching using the asterisk ( Citations:
Narrow the
🤖 Prompt for AI AgentsSource: Path instructions |
||||||
| "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 *)" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
python - <<'PY'
import json
path = "resources/grafana/sources/.claude/settings.local.json"
with open(path, encoding="utf-8") as stream:
rules = json.load(stream)["permissions"]["allow"]
rule = next(rule for rule in rules if rule.startswith("Bash(jj commit"))
body = rule[len("Bash("):-1]
if body.count("'") % 2:
raise SystemExit("Commit permission has unbalanced single quotes")
if body.endswith(" *"):
raise SystemExit("Commit permission is broader than the exact command")
PYRepository: stackrox/rhacs-observability-resources Length of output: 223 🌐 Web query:
💡 Result: Claude Code uses flexible pattern matching for Bash command permissions, supporting exact matches, wildcard patterns, and a specialized Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
sed -n '1,40p' resources/grafana/sources/.claude/settings.local.json | cat -nRepository: stackrox/rhacs-observability-resources Length of output: 789 Fix the commit permission pattern. The rule opens a single quote before the commit message but never closes it before Use an exact rule: Proposed fix- "Bash(jj commit -m 'ROX-34665: Add Scans per Day by Namespace panel to cluster overview dashboard *)"
+ "Bash(jj commit -m 'ROX-34665: Add Scans per Day by Namespace panel to cluster overview dashboard')"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| ] | ||||||
| } | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2119,13 +2119,150 @@ | |||||
| ], | ||||||
| "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]))", | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Restrict the query to the dashboard namespace scope. Line 2227 aggregates scans from every namespace in the datasource. It ignores the Proposed fix- "expr": "sum by (namespace) (increase(rox_central_scan_duration_count[1d]))",
+ "expr": "sum by (namespace) (increase(rox_central_scan_duration_count{namespace=~\"rhacs-$instance_id\"}[1d]))",As per path instructions, focus on “major issues impacting performance, readability, maintainability and security.” 📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Path instructions |
||||||
| "format": "table", | ||||||
| "instant": false, | ||||||
| "interval": "", | ||||||
| "legendFormat": "__auto", | ||||||
| "range": true, | ||||||
| "refId": "A" | ||||||
| } | ||||||
| ], | ||||||
| "timeFrom": "$_relativeTime/d", | ||||||
| "timeShift": "$_timeShift/d", | ||||||
| "title": "Scans per 24h 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 +2309,7 @@ | |||||
| "h": 13, | ||||||
| "w": 24, | ||||||
| "x": 0, | ||||||
| "y": 86 | ||||||
| "y": 94 | ||||||
| }, | ||||||
| "id": 148, | ||||||
| "options": { | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add this file to
.gitignore?