554 lines
16 KiB
JSON
554 lines
16 KiB
JSON
{
|
|
"dashboard": {
|
|
"id": null,
|
|
"title": "Cluster Monitoring Dashboard",
|
|
"tags": ["kubernetes", "monitoring", "cluster"],
|
|
"timezone": "browser",
|
|
"time": {
|
|
"from": "now-1h",
|
|
"to": "now"
|
|
},
|
|
"refresh": "30s",
|
|
"schemaVersion": 27,
|
|
"version": 1,
|
|
"panels": [
|
|
{
|
|
"id": 1,
|
|
"title": "Resource Utilization Overview",
|
|
"type": "row",
|
|
"collapsed": false,
|
|
"panels": [
|
|
{
|
|
"id": 2,
|
|
"title": "Cluster CPU Usage",
|
|
"type": "timeseries",
|
|
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 1},
|
|
"targets": [
|
|
{
|
|
"expr": "sum(rate(container_cpu_usage_seconds_total{id!=\"/\",pod!=\"\",namespace!=\"\"}[5m])) by (namespace)",
|
|
"legendFormat": "{{namespace}}",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "percentunit",
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "none"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 3,
|
|
"title": "Cluster Memory Usage",
|
|
"type": "timeseries",
|
|
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 1},
|
|
"targets": [
|
|
{
|
|
"expr": "sum(container_memory_usage_bytes{pod!=\"\",namespace!=\"\"}) by (namespace) / sum(kube_node_status_allocatable{resource=\"memory\"}) * 100",
|
|
"legendFormat": "{{namespace}}",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "percent",
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "none"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 4,
|
|
"title": "Storage Usage by Namespace",
|
|
"type": "timeseries",
|
|
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 9},
|
|
"targets": [
|
|
{
|
|
"expr": "sum(kube_persistentvolumeclaim_info * kubelet_volume_stats_used_bytes) by (namespace)",
|
|
"legendFormat": "{{namespace}}",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "bytes",
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "none"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 5,
|
|
"title": "Node Resource Utilization",
|
|
"type": "timeseries",
|
|
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 9},
|
|
"targets": [
|
|
{
|
|
"expr": "1 - sum by (instance) (rate(node_cpu_seconds_total{mode=\"idle\"}[5m]))",
|
|
"legendFormat": "{{instance}} CPU",
|
|
"refId": "A"
|
|
},
|
|
{
|
|
"expr": "1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)",
|
|
"legendFormat": "{{instance}} Memory",
|
|
"refId": "B"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "percentunit",
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "none"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": 6,
|
|
"title": "Application Health",
|
|
"type": "row",
|
|
"collapsed": false,
|
|
"panels": [
|
|
{
|
|
"id": 7,
|
|
"title": "Pod Status by Namespace",
|
|
"type": "timeseries",
|
|
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 17},
|
|
"targets": [
|
|
{
|
|
"expr": "sum by (namespace, phase) (kube_pod_status_phase)",
|
|
"legendFormat": "{{namespace}} - {{phase}}",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "none"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 8,
|
|
"title": "Pod Restarts by Namespace",
|
|
"type": "timeseries",
|
|
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 17},
|
|
"targets": [
|
|
{
|
|
"expr": "increase(kube_pod_container_status_restarts_total[5m]) > 0",
|
|
"legendFormat": "{{namespace}}/{{pod}}",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "desc"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 9,
|
|
"title": "Service Availability",
|
|
"type": "timeseries",
|
|
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 25},
|
|
"targets": [
|
|
{
|
|
"expr": "sum by (endpoint) (up{job=\"kube-state-metrics\"})",
|
|
"legendFormat": "{{endpoint}}",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
},
|
|
"min": 0,
|
|
"max": 1,
|
|
"thresholds": {
|
|
"steps": [
|
|
{"color": "red", "value": null},
|
|
{"color": "green", "value": 1}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "none"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 10,
|
|
"title": "Deployment Status",
|
|
"type": "stat",
|
|
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 25},
|
|
"targets": [
|
|
{
|
|
"expr": "sum(kube_deployment_status_replicas_available) / sum(kube_deployment_status_replicas) * 100",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "percent",
|
|
"color": {
|
|
"mode": "thresholds"
|
|
},
|
|
"thresholds": {
|
|
"steps": [
|
|
{"color": "red", "value": null},
|
|
{"color": "yellow", "value": 80},
|
|
{"color": "green", "value": 95}
|
|
]
|
|
},
|
|
"displayName": "Deployment Availability"
|
|
}
|
|
},
|
|
"reduceOptions": {
|
|
"values": false,
|
|
"calcs": ["lastNotNull"]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": 11,
|
|
"title": "Cost Metrics",
|
|
"type": "row",
|
|
"collapsed": false,
|
|
"panels": [
|
|
{
|
|
"id": 12,
|
|
"title": "Node Utilization Rate",
|
|
"type": "timeseries",
|
|
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 33},
|
|
"targets": [
|
|
{
|
|
"expr": "count(sum by (node) (kube_pod_info)) / count(kube_node_status_condition{condition=\"Ready\",status=\"true\"}) * 100",
|
|
"legendFormat": "Node Utilization %",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "percent",
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "none"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 13,
|
|
"title": "Storage Utilization Rate",
|
|
"type": "timeseries",
|
|
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 33},
|
|
"targets": [
|
|
{
|
|
"expr": "sum(kubelet_volume_stats_used_bytes) / sum(kubelet_volume_stats_capacity_bytes) * 100",
|
|
"legendFormat": "Storage Utilization %",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "percent",
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "none"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 14,
|
|
"title": "Resource Requests vs Limits",
|
|
"type": "timeseries",
|
|
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 41},
|
|
"targets": [
|
|
{
|
|
"expr": "sum(kube_pod_container_resource_requests_cpu_cores)",
|
|
"legendFormat": "CPU Requests",
|
|
"refId": "A"
|
|
},
|
|
{
|
|
"expr": "sum(kube_pod_container_resource_limits_cpu_cores)",
|
|
"legendFormat": "CPU Limits",
|
|
"refId": "B"
|
|
},
|
|
{
|
|
"expr": "sum(kube_node_status_allocatable{resource=\"cpu\"})",
|
|
"legendFormat": "Total CPU Allocatable",
|
|
"refId": "C"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "short",
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "none"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 15,
|
|
"title": "Storage Requests vs Usage",
|
|
"type": "timeseries",
|
|
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 41},
|
|
"targets": [
|
|
{
|
|
"expr": "sum(kube_persistentvolumeclaim_resource_requests_storage_bytes)",
|
|
"legendFormat": "Storage Requests",
|
|
"refId": "A"
|
|
},
|
|
{
|
|
"expr": "sum(kubelet_volume_stats_used_bytes)",
|
|
"legendFormat": "Storage Used",
|
|
"refId": "B"
|
|
},
|
|
{
|
|
"expr": "sum(kubelet_volume_stats_capacity_bytes)",
|
|
"legendFormat": "Total Storage Capacity",
|
|
"refId": "C"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "bytes",
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "none"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": 16,
|
|
"title": "Performance Metrics",
|
|
"type": "row",
|
|
"collapsed": false,
|
|
"panels": [
|
|
{
|
|
"id": 17,
|
|
"title": "Application Response Time",
|
|
"type": "timeseries",
|
|
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 49},
|
|
"targets": [
|
|
{
|
|
"expr": "histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket[5m])) by (le, namespace, route))",
|
|
"legendFormat": "{{namespace}} - {{route}} (p95)",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "s",
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "desc"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 18,
|
|
"title": "Request Rate",
|
|
"type": "timeseries",
|
|
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 49},
|
|
"targets": [
|
|
{
|
|
"expr": "sum(rate(http_requests_total[5m])) by (namespace, status)",
|
|
"legendFormat": "{{namespace}} - {{status}}",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "reqps",
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "none"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 19,
|
|
"title": "Throughput",
|
|
"type": "timeseries",
|
|
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 57},
|
|
"targets": [
|
|
{
|
|
"expr": "sum(rate(http_requests_total[5m]))",
|
|
"legendFormat": "Total Request Rate",
|
|
"refId": "A"
|
|
},
|
|
{
|
|
"expr": "sum by (namespace) (rate(http_requests_total[5m]))",
|
|
"legendFormat": "{{namespace}}",
|
|
"refId": "B"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "reqps",
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "desc"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 20,
|
|
"title": "Error Rate",
|
|
"type": "timeseries",
|
|
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 57},
|
|
"targets": [
|
|
{
|
|
"expr": "sum(rate(http_requests_total{status=~\"5..\"}[5m])) by (namespace) / sum(rate(http_requests_total[5m])) by (namespace) * 100",
|
|
"legendFormat": "{{namespace}} Error Rate %",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "percent",
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "desc"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"templating": {
|
|
"list": [
|
|
{
|
|
"name": "namespace",
|
|
"type": "query",
|
|
"query": "label_values(kube_pod_info, namespace)",
|
|
"refresh": 1,
|
|
"includeAll": true,
|
|
"allValue": ".*",
|
|
"multi": true,
|
|
"current": {
|
|
"selected": true,
|
|
"text": ["All"],
|
|
"value": ["$__all"]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"annotations": {
|
|
"list": [
|
|
{
|
|
"name": "Deployments",
|
|
"type": "tags",
|
|
"tags": ["deploy"],
|
|
"builtIn": 1
|
|
}
|
|
]
|
|
},
|
|
"links": [],
|
|
"timepicker": {
|
|
"refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"]
|
|
},
|
|
"description": "Comprehensive Kubernetes Cluster Monitoring Dashboard"
|
|
}
|
|
} |