Files
kyverno-2026-example/06-monitoring/01-logging/grafana-dashboard.json
2026-04-08 20:22:14 +07:00

131 lines
3.6 KiB
JSON

{
"title": "Kyverno Policy Dashboard",
"uid": "kyverno-main",
"tags": ["kyverno", "policy", "security"],
"timezone": "browser",
"refresh": "30s",
"panels": [
{
"id": 1,
"title": "Policy Compliance Rate",
"type": "stat",
"gridPos": {"h": 4, "w": 6, "x": 0, "y": 0},
"targets": [
{
"expr": "sum(rate(kyverno_policy_results_total{rule_result=\"pass\"}[5m])) / sum(rate(kyverno_policy_results_total[5m])) * 100",
"legendFormat": "Compliance %"
}
],
"options": {
"reduceOptions": {"calcs": ["lastNotNull"]},
"thresholds": {
"steps": [
{"color": "red", "value": 0},
{"color": "yellow", "value": 90},
{"color": "green", "value": 99}
]
}
}
},
{
"id": 2,
"title": "Admission Requests/s",
"type": "stat",
"gridPos": {"h": 4, "w": 6, "x": 6, "y": 0},
"targets": [
{
"expr": "sum(rate(kyverno_admission_requests_total[5m]))",
"legendFormat": "Requests/s"
}
]
},
{
"id": 3,
"title": "Admission Latency p95 (ms)",
"type": "stat",
"gridPos": {"h": 4, "w": 6, "x": 12, "y": 0},
"targets": [
{
"expr": "histogram_quantile(0.95, sum(rate(kyverno_admission_review_duration_seconds_bucket[5m])) by (le)) * 1000",
"legendFormat": "p95 latency"
}
],
"options": {
"thresholds": {
"steps": [
{"color": "green", "value": 0},
{"color": "yellow", "value": 100},
{"color": "red", "value": 500}
]
}
}
},
{
"id": 4,
"title": "Total Violations (24h)",
"type": "stat",
"gridPos": {"h": 4, "w": 6, "x": 18, "y": 0},
"targets": [
{
"expr": "sum(increase(kyverno_policy_results_total{rule_result=\"fail\"}[24h]))",
"legendFormat": "Violations"
}
],
"options": {
"thresholds": {
"steps": [
{"color": "green", "value": 0},
{"color": "yellow", "value": 10},
{"color": "red", "value": 100}
]
}
}
},
{
"id": 5,
"title": "Top Violated Policies (1h)",
"type": "bargauge",
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 4},
"targets": [
{
"expr": "topk(10, sum by(policy_name)(increase(kyverno_policy_results_total{rule_result=\"fail\"}[1h])))",
"legendFormat": "{{policy_name}}"
}
]
},
{
"id": 6,
"title": "Violations by Namespace (24h)",
"type": "table",
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 4},
"targets": [
{
"expr": "sort_desc(sum by(resource_namespace)(increase(kyverno_policy_results_total{rule_result=\"fail\"}[24h])))",
"legendFormat": "{{resource_namespace}}",
"instant": true
}
]
},
{
"id": 7,
"title": "Admission Latency over time",
"type": "timeseries",
"gridPos": {"h": 8, "w": 24, "x": 0, "y": 12},
"targets": [
{
"expr": "histogram_quantile(0.50, sum(rate(kyverno_admission_review_duration_seconds_bucket[5m])) by (le)) * 1000",
"legendFormat": "p50"
},
{
"expr": "histogram_quantile(0.95, sum(rate(kyverno_admission_review_duration_seconds_bucket[5m])) by (le)) * 1000",
"legendFormat": "p95"
},
{
"expr": "histogram_quantile(0.99, sum(rate(kyverno_admission_review_duration_seconds_bucket[5m])) by (le)) * 1000",
"legendFormat": "p99"
}
]
}
]
}