f4191f82f5
Co-authored-by: multica-agent <github@multica.ai>
289 lines
7.5 KiB
JSON
289 lines
7.5 KiB
JSON
{
|
|
"title": "OpenClaw Agent Health Dashboard",
|
|
"uid": "agent-health",
|
|
"version": 1,
|
|
"tags": ["openclaw", "agent", "monitoring"],
|
|
"timezone": "browser",
|
|
"editable": true,
|
|
"refresh": "30s",
|
|
"panels": [
|
|
{
|
|
"title": "系统资源概览",
|
|
"type": "row",
|
|
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 0}
|
|
},
|
|
{
|
|
"id": 1,
|
|
"title": "CPU 使用率",
|
|
"type": "gauge",
|
|
"gridPos": {"h": 8, "w": 6, "x": 0, "y": 1},
|
|
"targets": [
|
|
{
|
|
"expr": "100 - (avg by(instance) (rate(node_cpu_seconds_total{mode=\"idle\"}[5m])) * 100)",
|
|
"legendFormat": "{{instance}}"
|
|
}
|
|
],
|
|
"options": {
|
|
"reduceOptions": {"calcs": ["lastNotNull"]},
|
|
"showThresholdLabels": false,
|
|
"showThresholdMarkers": true
|
|
},
|
|
"thresholds": [
|
|
{"color": "green", "value": null},
|
|
{"color": "yellow", "value": 70},
|
|
{"color": "red", "value": 90}
|
|
]
|
|
},
|
|
{
|
|
"id": 2,
|
|
"title": "内存使用率",
|
|
"type": "gauge",
|
|
"gridPos": {"h": 8, "w": 6, "x": 6, "y": 1},
|
|
"targets": [
|
|
{
|
|
"expr": "(1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)) * 100",
|
|
"legendFormat": "{{instance}}"
|
|
}
|
|
],
|
|
"options": {
|
|
"reduceOptions": {"calcs": ["lastNotNull"]},
|
|
"showThresholdLabels": false,
|
|
"showThresholdMarkers": true
|
|
},
|
|
"thresholds": [
|
|
{"color": "green", "value": null},
|
|
{"color": "yellow", "value": 80},
|
|
{"color": "red", "value": 95}
|
|
]
|
|
},
|
|
{
|
|
"id": 3,
|
|
"title": "磁盘使用率",
|
|
"type": "gauge",
|
|
"gridPos": {"h": 8, "w": 6, "x": 12, "y": 1},
|
|
"targets": [
|
|
{
|
|
"expr": "max by(instance) ((node_filesystem_size_bytes - node_filesystem_free_bytes) / node_filesystem_size_bytes * 100)",
|
|
"legendFormat": "{{instance}}"
|
|
}
|
|
],
|
|
"options": {
|
|
"reduceOptions": {"calcs": ["lastNotNull"]},
|
|
"showThresholdLabels": false,
|
|
"showThresholdMarkers": true
|
|
},
|
|
"thresholds": [
|
|
{"color": "green", "value": null},
|
|
{"color": "yellow", "value": 80},
|
|
{"color": "red", "value": 95}
|
|
]
|
|
},
|
|
{
|
|
"id": 4,
|
|
"title": "系统负载",
|
|
"type": "stat",
|
|
"gridPos": {"h": 8, "w": 6, "x": 18, "y": 1},
|
|
"targets": [
|
|
{
|
|
"expr": "node_load1",
|
|
"legendFormat": "1min"
|
|
},
|
|
{
|
|
"expr": "node_load5",
|
|
"legendFormat": "5min"
|
|
},
|
|
{
|
|
"expr": "node_load15",
|
|
"legendFormat": "15min"
|
|
}
|
|
],
|
|
"options": {
|
|
"reduceOptions": {"calcs": ["lastNotNull"]},
|
|
"colorMode": "background",
|
|
"graphMode": "area",
|
|
"justifyMode": "auto",
|
|
"orientation": "horizontal",
|
|
"textMode": "auto"
|
|
}
|
|
},
|
|
{
|
|
"title": "Agent 健康状态",
|
|
"type": "row",
|
|
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 9}
|
|
},
|
|
{
|
|
"id": 5,
|
|
"title": "Agent 心跳状态",
|
|
"type": "table",
|
|
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 10},
|
|
"targets": [
|
|
{
|
|
"expr": "agent_heartbeat_status",
|
|
"legendFormat": "{{agent_label}}"
|
|
}
|
|
],
|
|
"transformations": [
|
|
{"id": "organize", "options": {"excludeByName": {}, "indexByName": {}, "renameByName": {"Value": "状态"}}}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"custom": {
|
|
"align": "center",
|
|
"displayMode": "color-background"
|
|
},
|
|
"mappings": [
|
|
{"type": "value", "options": {"0": {"color": "red", "text": "❌ 超时"}, "1": {"color": "green", "text": "✅ 正常"}}}
|
|
],
|
|
"thresholds": [{"color": "green", "value": null}]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 6,
|
|
"title": "任务停滞时长",
|
|
"type": "bargauge",
|
|
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 10},
|
|
"targets": [
|
|
{
|
|
"expr": "agent_task_stagnation_seconds",
|
|
"legendFormat": "{{agent_label}}"
|
|
}
|
|
],
|
|
"options": {
|
|
"orientation": "horizontal",
|
|
"displayMode": "gradient",
|
|
"showUnfilled": true
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "s",
|
|
"thresholds": [
|
|
{"color": "green", "value": null},
|
|
{"color": "yellow", "value": 3600},
|
|
{"color": "red", "value": 14400}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 7,
|
|
"title": "待办任务数",
|
|
"type": "stat",
|
|
"gridPos": {"h": 4, "w": 6, "x": 0, "y": 18},
|
|
"targets": [
|
|
{
|
|
"expr": "agent_workboard_pending",
|
|
"legendFormat": "待办任务"
|
|
}
|
|
],
|
|
"options": {
|
|
"reduceOptions": {"calcs": ["lastNotNull"]},
|
|
"colorMode": "background",
|
|
"graphMode": "area",
|
|
"textMode": "auto"
|
|
},
|
|
"thresholds": [
|
|
{"color": "green", "value": null},
|
|
{"color": "yellow", "value": 5},
|
|
{"color": "red", "value": 10}
|
|
]
|
|
},
|
|
{
|
|
"id": 8,
|
|
"title": "429 错误计数",
|
|
"type": "stat",
|
|
"gridPos": {"h": 4, "w": 6, "x": 6, "y": 18},
|
|
"targets": [
|
|
{
|
|
"expr": "agent_429_error_rate",
|
|
"legendFormat": "429 错误"
|
|
}
|
|
],
|
|
"options": {
|
|
"reduceOptions": {"calcs": ["lastNotNull"]},
|
|
"colorMode": "background",
|
|
"graphMode": "area",
|
|
"textMode": "auto"
|
|
},
|
|
"thresholds": [
|
|
{"color": "green", "value": null},
|
|
{"color": "yellow", "value": 10},
|
|
{"color": "red", "value": 50}
|
|
]
|
|
},
|
|
{
|
|
"id": 9,
|
|
"title": "Prometheus 目标状态",
|
|
"type": "table",
|
|
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 18},
|
|
"targets": [
|
|
{
|
|
"expr": "up",
|
|
"legendFormat": "{{job}} ({{instance}})"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"custom": {"align": "center", "displayMode": "color-background"},
|
|
"mappings": [
|
|
{"type": "value", "options": {"0": {"color": "red", "text": "❌ Down"}, "1": {"color": "green", "text": "✅ Up"}}}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"title": "告警状态",
|
|
"type": "row",
|
|
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 26}
|
|
},
|
|
{
|
|
"id": 10,
|
|
"title": "活跃告警",
|
|
"type": "table",
|
|
"gridPos": {"h": 8, "w": 24, "x": 0, "y": 27},
|
|
"targets": [
|
|
{
|
|
"expr": "ALERTS{alertstate=\"firing\"}",
|
|
"legendFormat": "{{alertname}}"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"custom": {"align": "left"},
|
|
"mappings": [
|
|
{"type": "value", "options": {"0": {"color": "green", "text": "已恢复"}, "1": {"color": "red", "text": "触发中"}}}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"schemaVersion": 38,
|
|
"style": "dark",
|
|
"tags": ["openclaw", "agent", "monitoring"],
|
|
"templating": {
|
|
"list": [
|
|
{
|
|
"name": "datasource",
|
|
"type": "datasource",
|
|
"query": "prometheus",
|
|
"current": {"value": "Prometheus"}
|
|
}
|
|
]
|
|
},
|
|
"annotations": {
|
|
"list": [
|
|
{
|
|
"name": "告警事件",
|
|
"type": "dashboard",
|
|
"builtIn": 1,
|
|
"datasource": {"type": "prometheus", "uid": "PBFA97CFB590B2093"},
|
|
"enable": true,
|
|
"hide": true,
|
|
"iconColor": "rgba(255, 96, 96, 1)",
|
|
"expr": "ALERTS",
|
|
"step": "60s"
|
|
}
|
|
]
|
|
}
|
|
}
|