1
0
Fork 0
mirror of https://github.com/kyverno/policy-reporter.git synced 2024-12-14 11:57:32 +00:00

feat: update panels that used deprecated angular plugins (#456)

Signed-off-by: Timo Hankamer <timo.hankamer@brainbits.net>
This commit is contained in:
Timo Hankamer 2024-06-24 11:28:57 +02:00 committed by GitHub
parent 7c5a373258
commit 6a1c166b9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 410 additions and 278 deletions

View file

@ -309,102 +309,146 @@ data:
} }
{{- if .Values.clusterPolicyReportDetails.statusTimeline.enabled }} {{- if .Values.clusterPolicyReportDetails.statusTimeline.enabled }}
,{ ,{
"aliasColors": {}, "datasource": {
"bars": false, "uid": "${DS_PROMETHEUS}",
"dashLength": 10, "type": "prometheus"
"dashes": false, },
"datasource": "${DS_PROMETHEUS}", "fieldConfig": {
"fieldConfig": {
"defaults": { "defaults": {
"custom": {} "custom": {
"drawStyle": "line",
"lineInterpolation": "linear",
"barAlignment": 0,
"lineWidth": 1,
"fillOpacity": 10,
"gradientMode": "none",
"spanNulls": false,
"insertNulls": false,
"showPoints": "never",
"pointSize": 5,
"stacking": {
"mode": "none",
"group": "A"
},
"axisPlacement": "auto",
"axisLabel": "",
"axisColorMode": "text",
"axisBorderShow": false,
"scaleDistribution": {
"type": "linear"
},
"axisCenteredZero": false,
"hideFrom": {
"tooltip": false,
"viz": false,
"legend": false
},
"thresholdsStyle": {
"mode": "off"
}
},
"color": {
"mode": "palette-classic"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"value": null,
"color": "green"
},
{
"value": 80,
"color": "red"
}
]
},
"unit": "none",
"decimals": 0,
"min": 0
}, },
"overrides": [] "overrides": [
}, {
"fill": 1, "matcher": {
"fillGradient": 0, "id": "byValue",
"gridPos": { "options": {
"reducer": "allIsZero",
"op": "gte",
"value": 0
}
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"tooltip": true,
"viz": false,
"legend": true
}
}
]
},
{
"matcher": {
"id": "byValue",
"options": {
"reducer": "allIsNull",
"op": "gte",
"value": 0
}
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"tooltip": true,
"viz": false,
"legend": true
}
}
]
}
]
},
"gridPos": {
"h": {{ .Values.clusterPolicyReportDetails.statusTimeline.height }}, "h": {{ .Values.clusterPolicyReportDetails.statusTimeline.height }},
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 7 "y": 6
}, },
"hiddenSeries": false, "id": 13,
"id": 13, "pluginVersion": "10.4.1",
"legend": { "targets": [
"alignAsTable": true,
"avg": false,
"current": true,
"hideEmpty": true,
"hideZero": true,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null as zero",
"percentage": false,
"pluginVersion": "7.1.5",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{ {
"expr": "sum(cluster_policy_report_result{policy=~\"$policy\", category=~\"$category\", severity=~\"$severity\", source=~\"$source\", kind=~\"$kind\"{{ range $filters }}, {{.}}=~\"${{.}}\"{{ end }} } > 0) by (status)", "expr": "sum(cluster_policy_report_result{policy=~\"$policy\", category=~\"$category\", severity=~\"$severity\", source=~\"$source\", kind=~\"$kind\"{{ range $filters }}, {{.}}=~\"${{.}}\"{{ end }} } > 0) by (status)",
"interval": "", "interval": "",
"legendFormat": "{{`{{ status }}`}}", "legendFormat": "{{`{{ status }}`}}",
"refId": "A" "refId": "A",
"datasource": {
"uid": "prometheus",
"type": "prometheus"
}
} }
], ],
"thresholds": [], "title": "Status Timeline",
"timeFrom": null, "type": "timeseries",
"timeRegions": [], "options": {
"timeShift": null, "tooltip": {
"title": "Status Timeline", "mode": "multi",
"tooltip": { "sort": "none"
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": 0,
"format": "none",
"label": null,
"logBase": 1,
"max": null,
"min": "0",
"show": true
}, },
{ "legend": {
"decimals": 0, "showLegend": true,
"format": "short", "displayMode": "table",
"label": null, "placement": "right",
"logBase": 1, "calcs": [
"max": null, "lastNotNull"
"min": null, ]
"show": true
} }
], },
"yaxis": { "timeFrom": null,
"align": false, "timeShift": null
"alignLevel": null
}
} }
{{- end }} {{- end }}
{{- if .Values.clusterPolicyReportDetails.passTable.enabled }} {{- if .Values.clusterPolicyReportDetails.passTable.enabled }}
@ -863,7 +907,7 @@ data:
"type": "query", "type": "query",
"useTags": false "useTags": false
} }
{{- end }} {{- end }}
] ]
}, },
"time": { "time": {
@ -889,4 +933,4 @@ data:
"uid": "iyJszGUMk", "uid": "iyJszGUMk",
"version": 1 "version": 1
} }
{{- end }} {{- end }}

View file

@ -28,22 +28,22 @@ metadata:
data: data:
policy-reporter-dashboard.json: | policy-reporter-dashboard.json: |
{ {
"__inputs": [ "__inputs": [
{ {
"name": "DS_PROMETHEUS", "name": "DS_PROMETHEUS",
"label": "{{ .Values.grafana.datasource.label }}", "label": "{{ .Values.grafana.datasource.label }}",
"description": "", "description": "",
"type": "datasource", "type": "datasource",
"pluginId": "{{ .Values.grafana.datasource.pluginId }}", "pluginId": "{{ .Values.grafana.datasource.pluginId }}",
"pluginName": "{{ .Values.grafana.datasource.pluginName }}" "pluginName": "{{ .Values.grafana.datasource.pluginName }}"
} }
], ],
"__requires": [ "__requires": [
{ {
"type": "grafana", "type": "grafana",
"id": "grafana", "id": "grafana",
"name": "Grafana", "name": "Grafana",
"version": "7.1.5" "version": "7.1.5"
} }
], ],
"annotations": { "annotations": {
@ -190,107 +190,153 @@ data:
"type": "stat" "type": "stat"
}, },
{ {
"aliasColors": {}, "datasource": {
"bars": false, "uid": "${DS_PROMETHEUS}"
"dashLength": 10, },
"dashes": false, "fieldConfig": {
"datasource": "${DS_PROMETHEUS}",
"fieldConfig": {
"defaults": { "defaults": {
"custom": {} "custom": {
"drawStyle": "line",
"lineInterpolation": "linear",
"barAlignment": 0,
"lineWidth": 1,
"fillOpacity": 10,
"gradientMode": "none",
"spanNulls": false,
"insertNulls": false,
"showPoints": "never",
"pointSize": 5,
"stacking": {
"mode": "none",
"group": "A"
},
"axisPlacement": "auto",
"axisLabel": "",
"axisColorMode": "text",
"axisBorderShow": false,
"scaleDistribution": {
"type": "linear"
},
"axisCenteredZero": false,
"hideFrom": {
"tooltip": false,
"viz": false,
"legend": false
},
"thresholdsStyle": {
"mode": "off"
}
},
"color": {
"mode": "palette-classic"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"value": null,
"color": "green"
},
{
"value": 80,
"color": "red"
}
]
},
"unit": "short",
"decimals": 0,
"min": 0
}, },
"overrides": [] "overrides": [
}, {
"fill": 1, "matcher": {
"fillGradient": 0, "id": "byValue",
"gridPos": { "options": {
"reducer": "allIsZero",
"op": "gte",
"value": 0
}
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"tooltip": true,
"viz": false,
"legend": true
}
}
]
},
{
"matcher": {
"id": "byValue",
"options": {
"reducer": "allIsNull",
"op": "gte",
"value": 0
}
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"tooltip": true,
"viz": false,
"legend": true
}
}
]
}
]
},
"gridPos": {
"h": {{ .Values.policyReportOverview.failingTimeline.height }}, "h": {{ .Values.policyReportOverview.failingTimeline.height }},
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 10 "y": 8
}, },
"hiddenSeries": false, "id": 11,
"id": 11, "pluginVersion": "10.4.1",
"legend": { "targets": [
"alignAsTable": true,
"avg": false,
"current": true,
"hideEmpty": true,
"hideZero": true,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null as zero",
"percentage": false,
"pluginVersion": "7.1.5",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{ {
"expr": "sum(cluster_policy_report_result{policy=~\"$policy\", category=~\"$category\", severity=~\"$severity\", source=~\"$source\", kind=~\"$kind\", status=~\"fail|error\"{{ range $filters }}, {{.}}=~\"${{.}}\"{{ end }} } > 0) by (policy)", "expr": "sum(cluster_policy_report_result{policy=~\"$policy\", category=~\"$category\", severity=~\"$severity\", source=~\"$source\", kind=~\"$kind\", status=~\"fail|error\"{{ range $filters }}, {{.}}=~\"${{.}}\"{{ end }} } > 0) by (policy)",
"interval": "", "interval": "",
"legendFormat": "{{`{{ policy }}`}}", "legendFormat": "{{`{{ policy }}`}}",
"refId": "A" "refId": "A",
"datasource": {
"uid": "${DS_PROMETHEUS}"
}
}, },
{ {
"expr": "sum(policy_report_result{policy=~\"$policy\", category=~\"$category\", severity=~\"$severity\", source=~\"$source\", kind=~\"$kind\", {{ $nsLabel }}=~\"$namespace\", status=~\"fail|error\"{{ range $filters }}, {{.}}=~\"${{.}}\"{{ end }} } > 0) by (policy)", "expr": "sum(policy_report_result{policy=~\"$policy\", category=~\"$category\", severity=~\"$severity\", source=~\"$source\", kind=~\"$kind\", {{ $nsLabel }}=~\"$namespace\", status=~\"fail|error\"{{ range $filters }}, {{.}}=~\"${{.}}\"{{ end }} } > 0) by (policy)",
"interval": "", "interval": "",
"legendFormat": "{{`{{ policy }}`}}", "legendFormat": "{{`{{ policy }}`}}",
"refId": "B" "refId": "B",
"datasource": {
"uid": "${DS_PROMETHEUS}"
}
} }
], ],
"thresholds": [], "title": "Failing Policies Graph",
"timeFrom": null, "type": "timeseries",
"timeRegions": [], "options": {
"timeShift": null, "tooltip": {
"title": "Failing Policies Graph", "mode": "multi",
"tooltip": { "sort": "none"
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": 0,
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": "0",
"show": true
}, },
{ "legend": {
"format": "short", "showLegend": true,
"label": null, "displayMode": "table",
"logBase": 1, "placement": "right",
"max": null, "calcs": [
"min": null, "lastNotNull"
"show": true ]
} }
], },
"yaxis": { "timeFrom": null,
"align": false, "timeShift": null
"alignLevel": null
}
}, },
{ {
"datasource": "${DS_PROMETHEUS}", "datasource": "${DS_PROMETHEUS}",
@ -614,7 +660,7 @@ data:
"type": "query", "type": "query",
"useTags": false "useTags": false
} }
{{- end }} {{- end }}
] ]
}, },
"time": { "time": {
@ -639,4 +685,4 @@ data:
"title": "PolicyReports", "title": "PolicyReports",
"version": 1 "version": 1
} }
{{- end }} {{- end }}

View file

@ -306,102 +306,144 @@ data:
{{- end }} {{- end }}
{{- if .Values.policyReportDetails.statusTimeline.enabled }} {{- if .Values.policyReportDetails.statusTimeline.enabled }}
,{ ,{
"aliasColors": {}, "datasource": {
"bars": false, "uid": "${DS_PROMETHEUS}"
"dashLength": 10, },
"dashes": false, "fieldConfig": {
"datasource": "${DS_PROMETHEUS}",
"fieldConfig": {
"defaults": { "defaults": {
"custom": {} "custom": {
"drawStyle": "line",
"lineInterpolation": "linear",
"barAlignment": 0,
"lineWidth": 1,
"fillOpacity": 10,
"gradientMode": "none",
"spanNulls": false,
"insertNulls": false,
"showPoints": "never",
"pointSize": 5,
"stacking": {
"mode": "none",
"group": "A"
},
"axisPlacement": "auto",
"axisLabel": "",
"axisColorMode": "text",
"axisBorderShow": false,
"scaleDistribution": {
"type": "linear"
},
"axisCenteredZero": false,
"hideFrom": {
"tooltip": false,
"viz": false,
"legend": false
},
"thresholdsStyle": {
"mode": "off"
}
},
"color": {
"mode": "palette-classic"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"value": null,
"color": "green"
},
{
"value": 80,
"color": "red"
}
]
},
"unit": "none",
"decimals": 0,
"min": 0
}, },
"overrides": [] "overrides": [
}, {
"fill": 1, "matcher": {
"fillGradient": 0, "id": "byValue",
"gridPos": { "options": {
"reducer": "allIsZero",
"op": "gte",
"value": 0
}
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"tooltip": true,
"viz": false,
"legend": true
}
}
]
},
{
"matcher": {
"id": "byValue",
"options": {
"reducer": "allIsNull",
"op": "gte",
"value": 0
}
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"tooltip": true,
"viz": false,
"legend": true
}
}
]
}
]
},
"gridPos": {
"h": {{ .Values.policyReportDetails.statusTimeline.height }}, "h": {{ .Values.policyReportDetails.statusTimeline.height }},
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 11 "y": 10
}, },
"hiddenSeries": false, "id": 13,
"id": 13, "pluginVersion": "10.4.1",
"legend": { "targets": [
"alignAsTable": true,
"avg": false,
"current": true,
"hideEmpty": true,
"hideZero": true,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null as zero",
"percentage": false,
"pluginVersion": "7.1.5",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{ {
"expr": "sum(policy_report_result{policy=~\"$policy\", rule=~\"$rule\", category=~\"$category\", severity=~\"$severity\", source=~\"$source\", kind=~\"$kind\", {{ $nsLabel }}=~\"$namespace\"{{ range $filters }}, {{.}}=~\"${{.}}\"{{ end }} } > 0) by (status, {{ $nsLabel }})", "expr": "sum(policy_report_result{policy=~\"$policy\", rule=~\"$rule\", category=~\"$category\", severity=~\"$severity\", source=~\"$source\", kind=~\"$kind\", {{ $nsLabel }}=~\"$namespace\"{{ range $filters }}, {{.}}=~\"${{.}}\"{{ end }} } > 0) by (status, {{ $nsLabel }})",
"interval": "", "interval": "",
"legendFormat": "{{ printf `{{%s}}` $nsLabel }} {{`{{ status }}`}}", "legendFormat": "{{ printf `{{%s}}` $nsLabel }} {{`{{ status }}`}}",
"refId": "A" "refId": "A",
"datasource": {
"uid": "${DS_PROMETHEUS}"
}
} }
], ],
"thresholds": [], "title": "Status Timeline",
"timeFrom": null, "type": "timeseries",
"timeRegions": [], "options": {
"timeShift": null, "tooltip": {
"title": "Status Timeline", "mode": "multi",
"tooltip": { "sort": "none"
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": 0,
"format": "none",
"label": null,
"logBase": 1,
"max": null,
"min": "0",
"show": true
}, },
{ "legend": {
"decimals": 0, "showLegend": true,
"format": "short", "displayMode": "table",
"label": null, "placement": "right",
"logBase": 1, "calcs": [
"max": null, "lastNotNull"
"min": null, ]
"show": true
} }
], },
"yaxis": { "timeFrom": null,
"align": false, "timeShift": null
"alignLevel": null
}
} }
{{- end }} {{- end }}
{{- if .Values.policyReportDetails.passTable.enabled }} {{- if .Values.policyReportDetails.passTable.enabled }}