Files
grafana-dashboard/GBarmUB/docker-container-metrics.json
2025-10-27 19:03:20 +08:00

870 lines
21 KiB
JSON

{
"apiVersion": "dashboard.grafana.app/v1beta1",
"kind": "Dashboard",
"metadata": {
"name": "b0ae5882-f3a7-45c5-a4da-21a4815f8ed0"
},
"spec": {
"panels": [
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 1,
"title": "Overview",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "ff1qkncht70n4c"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
}
},
"gridPos": {
"h": 4,
"w": 6,
"x": 0,
"y": 1
},
"id": 2,
"options": {
"colorMode": "value",
"graphMode": "none",
"textMode": "auto"
},
"targets": [
{
"expr": "count(rate(container_last_seen{name=~\"$container\",name!=\"\"}[5m]))",
"refId": "A"
}
],
"title": "Running Containers",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "ff1qkncht70n4c"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "yellow",
"value": 60
},
{
"color": "red",
"value": 80
}
]
},
"unit": "percent"
}
},
"gridPos": {
"h": 4,
"w": 6,
"x": 6,
"y": 1
},
"id": 3,
"options": {
"colorMode": "value",
"graphMode": "area"
},
"targets": [
{
"expr": "sum(rate(container_cpu_usage_seconds_total{name=~\"$container\",name!=\"\"}[5m])) * 100",
"refId": "A"
}
],
"title": "Total CPU Usage",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "ff1qkncht70n4c"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "yellow",
"value": 8589934592
},
{
"color": "red",
"value": 17179869184
}
]
},
"unit": "bytes"
}
},
"gridPos": {
"h": 4,
"w": 6,
"x": 12,
"y": 1
},
"id": 4,
"options": {
"colorMode": "value",
"graphMode": "area"
},
"targets": [
{
"expr": "sum(container_memory_usage_bytes{name=~\"$container\",name!=\"\"})",
"refId": "A"
}
],
"title": "Total Memory Usage",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "ff1qkncht70n4c"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"unit": "Bps"
}
},
"gridPos": {
"h": 4,
"w": 6,
"x": 18,
"y": 1
},
"id": 5,
"options": {
"colorMode": "value",
"graphMode": "area"
},
"targets": [
{
"expr": "sum(rate(container_network_receive_bytes_total{name=~\"$container\",name!=\"\"}[5m])) + sum(rate(container_network_transmit_bytes_total{name=~\"$container\",name!=\"\"}[5m]))",
"refId": "A"
}
],
"title": "Total Network I/O",
"type": "stat"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 5
},
"id": 10,
"title": "CPU Metrics",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "ff1qkncht70n4c"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"drawStyle": "line",
"fillOpacity": 10,
"lineInterpolation": "smooth",
"showPoints": "never"
},
"unit": "percent"
}
},
"gridPos": {
"h": 8,
"w": 16,
"x": 0,
"y": 6
},
"id": 11,
"options": {
"legend": {
"calcs": [
"last",
"max",
"mean"
],
"displayMode": "table",
"placement": "right"
}
},
"targets": [
{
"expr": "rate(container_cpu_usage_seconds_total{name=~\"$container\",name!=\"\"}[5m]) * 100",
"legendFormat": "{{name}}",
"refId": "A"
}
],
"title": "CPU Usage per Container",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "ff1qkncht70n4c"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"max": 100,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "yellow",
"value": 60
},
{
"color": "red",
"value": 80
}
]
},
"unit": "percent"
}
},
"gridPos": {
"h": 8,
"w": 8,
"x": 16,
"y": 6
},
"id": 12,
"options": {
"displayMode": "gradient",
"orientation": "horizontal",
"showUnfilled": true
},
"targets": [
{
"expr": "rate(container_cpu_usage_seconds_total{name=~\"$container\",name!=\"\"}[5m]) * 100",
"legendFormat": "{{name}}",
"refId": "A"
}
],
"title": "Current CPU Usage",
"type": "bargauge"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 14
},
"id": 20,
"title": "Memory Metrics",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "ff1qkncht70n4c"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"drawStyle": "line",
"fillOpacity": 10,
"lineInterpolation": "smooth",
"showPoints": "never"
},
"unit": "bytes"
}
},
"gridPos": {
"h": 8,
"w": 16,
"x": 0,
"y": 15
},
"id": 21,
"options": {
"legend": {
"calcs": [
"last",
"max",
"mean"
],
"displayMode": "table",
"placement": "right"
}
},
"targets": [
{
"expr": "container_memory_usage_bytes{name=~\"$container\",name!=\"\"}",
"legendFormat": "{{name}}",
"refId": "A"
}
],
"title": "Memory Usage per Container",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "ff1qkncht70n4c"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"max": 100,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "yellow",
"value": 70
},
{
"color": "red",
"value": 90
}
]
},
"unit": "percent"
}
},
"gridPos": {
"h": 8,
"w": 8,
"x": 16,
"y": 15
},
"id": 22,
"options": {
"displayMode": "gradient",
"orientation": "horizontal",
"showUnfilled": true
},
"targets": [
{
"expr": "(container_memory_usage_bytes{name=~\"$container\",name!=\"\"} / container_spec_memory_limit_bytes{name=~\"$container\",name!=\"\"}) * 100",
"legendFormat": "{{name}}",
"refId": "A"
}
],
"title": "Memory Usage (% of Limit)",
"type": "bargauge"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 23
},
"id": 30,
"title": "Network Metrics",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "ff1qkncht70n4c"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"drawStyle": "line",
"fillOpacity": 10,
"lineInterpolation": "smooth",
"showPoints": "never"
},
"unit": "Bps"
}
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 24
},
"id": 31,
"options": {
"legend": {
"calcs": [
"last",
"max",
"mean"
],
"displayMode": "table",
"placement": "bottom"
}
},
"targets": [
{
"expr": "rate(container_network_receive_bytes_total{name=~\"$container\",name!=\"\"}[5m])",
"legendFormat": "{{name}} - {{interface}}",
"refId": "A"
}
],
"title": "Network Receive Rate",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "ff1qkncht70n4c"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"drawStyle": "line",
"fillOpacity": 10,
"lineInterpolation": "smooth",
"showPoints": "never"
},
"unit": "Bps"
}
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 24
},
"id": 32,
"options": {
"legend": {
"calcs": [
"last",
"max",
"mean"
],
"displayMode": "table",
"placement": "bottom"
}
},
"targets": [
{
"expr": "rate(container_network_transmit_bytes_total{name=~\"$container\",name!=\"\"}[5m])",
"legendFormat": "{{name}} - {{interface}}",
"refId": "A"
}
],
"title": "Network Transmit Rate",
"type": "timeseries"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 32
},
"id": 40,
"title": "Disk I/O Metrics",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "ff1qkncht70n4c"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"drawStyle": "line",
"fillOpacity": 10,
"lineInterpolation": "smooth",
"showPoints": "never"
},
"unit": "Bps"
}
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 33
},
"id": 41,
"options": {
"legend": {
"calcs": [
"last",
"max",
"mean"
],
"displayMode": "table",
"placement": "bottom"
}
},
"targets": [
{
"expr": "rate(container_fs_reads_bytes_total{name=~\"$container\",name!=\"\"}[5m])",
"legendFormat": "{{name}} - {{device}}",
"refId": "A"
}
],
"title": "Disk Read Rate",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "ff1qkncht70n4c"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"drawStyle": "line",
"fillOpacity": 10,
"lineInterpolation": "smooth",
"showPoints": "never"
},
"unit": "Bps"
}
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 33
},
"id": 42,
"options": {
"legend": {
"calcs": [
"last",
"max",
"mean"
],
"displayMode": "table",
"placement": "bottom"
}
},
"targets": [
{
"expr": "rate(container_fs_writes_bytes_total{name=~\"$container\",name!=\"\"}[5m])",
"legendFormat": "{{name}} - {{device}}",
"refId": "A"
}
],
"title": "Disk Write Rate",
"type": "timeseries"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 41
},
"id": 50,
"title": "Container Details",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "ff1qkncht70n4c"
},
"fieldConfig": {
"defaults": {},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Value #A"
},
"properties": [
{
"id": "displayName",
"value": "Last Seen"
},
{
"id": "unit",
"value": "dateTimeAsIso"
}
]
},
{
"matcher": {
"id": "byName",
"options": "Value #B"
},
"properties": [
{
"id": "displayName",
"value": "CPU %"
},
{
"id": "unit",
"value": "percent"
},
{
"id": "custom.cellOptions",
"value": {
"type": "color-background"
}
},
{
"id": "thresholds",
"value": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "yellow",
"value": 60
},
{
"color": "red",
"value": 80
}
]
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "Value #C"
},
"properties": [
{
"id": "displayName",
"value": "Memory"
},
{
"id": "unit",
"value": "bytes"
}
]
},
{
"matcher": {
"id": "byName",
"options": "Value #D"
},
"properties": [
{
"id": "displayName",
"value": "Net RX"
},
{
"id": "unit",
"value": "Bps"
}
]
},
{
"matcher": {
"id": "byName",
"options": "Value #E"
},
"properties": [
{
"id": "displayName",
"value": "Net TX"
},
{
"id": "unit",
"value": "Bps"
}
]
}
]
},
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 42
},
"id": 51,
"options": {
"showHeader": true,
"sortBy": []
},
"targets": [
{
"expr": "container_last_seen{name=~\"$container\",name!=\"\"}",
"format": "table",
"instant": true,
"legendFormat": "{{name}}",
"refId": "A"
},
{
"expr": "rate(container_cpu_usage_seconds_total{name=~\"$container\",name!=\"\"}[5m]) * 100",
"format": "table",
"instant": true,
"legendFormat": "{{name}}",
"refId": "B"
},
{
"expr": "container_memory_usage_bytes{name=~\"$container\",name!=\"\"}",
"format": "table",
"instant": true,
"legendFormat": "{{name}}",
"refId": "C"
},
{
"expr": "rate(container_network_receive_bytes_total{name=~\"$container\",name!=\"\"}[5m])",
"format": "table",
"instant": true,
"legendFormat": "{{name}}",
"refId": "D"
},
{
"expr": "rate(container_network_transmit_bytes_total{name=~\"$container\",name!=\"\"}[5m])",
"format": "table",
"instant": true,
"legendFormat": "{{name}}",
"refId": "E"
}
],
"title": "Container Status Overview",
"transformations": [
{
"id": "merge",
"options": {}
},
{
"id": "organize",
"options": {
"excludeByName": {
"Time": true,
"id": true,
"image": true,
"instance": true,
"job": true
},
"indexByName": {
"Value #A": 1,
"Value #B": 2,
"Value #C": 3,
"Value #D": 4,
"Value #E": 5,
"name": 0
}
}
}
],
"type": "table"
}
],
"refresh": "30s",
"schemaVersion": 42,
"tags": [
"docker",
"containers",
"monitoring"
],
"templating": {
"list": [
{
"allValue": ".*",
"datasource": {
"type": "prometheus",
"uid": "ff1qkncht70n4c"
},
"includeAll": true,
"label": "Container",
"multi": true,
"name": "container",
"query": {
"query": "label_values(container_last_seen{name!=\"\"},name)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
"sort": 1,
"type": "query"
}
]
},
"timezone": "browser",
"title": "Docker Container Metrics"
}
}