-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdashboard-system-monitoring.json
More file actions
313 lines (313 loc) · 9.71 KB
/
Copy pathdashboard-system-monitoring.json
File metadata and controls
313 lines (313 loc) · 9.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
{
"dashboard": {
"title": "系統監控 - GPU / CPU / Memory / Container Stats",
"tags": ["monitoring", "gpu", "docker"],
"timezone": "browser",
"schemaVersion": 38,
"version": 1,
"refresh": "10s",
"time": {
"from": "now-30m",
"to": "now"
},
"panels": [
{
"id": 1,
"title": "GPU 使用率",
"type": "timeseries",
"gridPos": {"x": 0, "y": 0, "w": 12, "h": 8},
"targets": [
{
"expr": "DCGM_FI_DEV_GPU_UTIL",
"legendFormat": "GPU {{gpu}} - {{modelName}}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "percent",
"min": 0,
"max": 100,
"color": {"mode": "palette-classic"},
"custom": {
"drawStyle": "line",
"lineInterpolation": "smooth",
"fillOpacity": 10
}
}
},
"options": {
"legend": {"displayMode": "table", "placement": "right"}
}
},
{
"id": 2,
"title": "GPU 記憶體使用量",
"type": "timeseries",
"gridPos": {"x": 12, "y": 0, "w": 12, "h": 8},
"targets": [
{
"expr": "DCGM_FI_DEV_FB_USED",
"legendFormat": "GPU {{gpu}} Used",
"refId": "A"
},
{
"expr": "DCGM_FI_DEV_FB_FREE",
"legendFormat": "GPU {{gpu}} Free",
"refId": "B"
}
],
"fieldConfig": {
"defaults": {
"unit": "decmbytes",
"color": {"mode": "palette-classic"},
"custom": {
"drawStyle": "line",
"lineInterpolation": "smooth",
"fillOpacity": 10,
"stacking": {"mode": "normal"}
}
}
},
"options": {
"legend": {"displayMode": "table", "placement": "right"}
}
},
{
"id": 3,
"title": "GPU 溫度",
"type": "timeseries",
"gridPos": {"x": 0, "y": 8, "w": 12, "h": 6},
"targets": [
{
"expr": "DCGM_FI_DEV_GPU_TEMP",
"legendFormat": "GPU {{gpu}} Temperature",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "celsius",
"color": {"mode": "thresholds"},
"thresholds": {
"mode": "absolute",
"steps": [
{"value": null, "color": "green"},
{"value": 70, "color": "yellow"},
{"value": 85, "color": "red"}
]
},
"custom": {
"drawStyle": "line",
"lineInterpolation": "smooth",
"fillOpacity": 20
}
}
},
"options": {
"legend": {"displayMode": "list", "placement": "bottom"}
}
},
{
"id": 4,
"title": "GPU 功耗",
"type": "timeseries",
"gridPos": {"x": 12, "y": 8, "w": 12, "h": 6},
"targets": [
{
"expr": "DCGM_FI_DEV_POWER_USAGE",
"legendFormat": "GPU {{gpu}} Power",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "watt",
"color": {"mode": "palette-classic"},
"custom": {
"drawStyle": "line",
"lineInterpolation": "smooth",
"fillOpacity": 10
}
}
},
"options": {
"legend": {"displayMode": "list", "placement": "bottom"}
}
},
{
"id": 5,
"title": "容器 CPU 使用率(Top 10)",
"type": "timeseries",
"gridPos": {"x": 0, "y": 14, "w": 12, "h": 8},
"targets": [
{
"expr": "topk(10, rate(container_cpu_usage_seconds_total{name=~\".+\"}[5m]) * 100)",
"legendFormat": "{{name}}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "percent",
"color": {"mode": "palette-classic"},
"custom": {
"drawStyle": "line",
"lineInterpolation": "smooth",
"fillOpacity": 10
}
}
},
"options": {
"legend": {"displayMode": "table", "placement": "right", "calcs": ["lastNotNull", "max"]}
}
},
{
"id": 6,
"title": "容器記憶體使用量(Top 10)",
"type": "timeseries",
"gridPos": {"x": 12, "y": 14, "w": 12, "h": 8},
"targets": [
{
"expr": "topk(10, container_memory_usage_bytes{name=~\".+\"} / 1024 / 1024)",
"legendFormat": "{{name}}",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "decmbytes",
"color": {"mode": "palette-classic"},
"custom": {
"drawStyle": "line",
"lineInterpolation": "smooth",
"fillOpacity": 10
}
}
},
"options": {
"legend": {"displayMode": "table", "placement": "right", "calcs": ["lastNotNull", "max"]}
}
},
{
"id": 7,
"title": "immich_machine_learning - CPU 使用率",
"type": "stat",
"gridPos": {"x": 0, "y": 22, "w": 6, "h": 4},
"targets": [
{
"expr": "rate(container_cpu_usage_seconds_total{name=\"immich_machine_learning\"}[5m]) * 100",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "percent",
"color": {"mode": "thresholds"},
"thresholds": {
"mode": "absolute",
"steps": [
{"value": null, "color": "green"},
{"value": 50, "color": "yellow"},
{"value": 80, "color": "red"}
]
}
}
},
"options": {
"colorMode": "background",
"graphMode": "area",
"orientation": "auto"
}
},
{
"id": 8,
"title": "immich_machine_learning - 記憶體使用",
"type": "stat",
"gridPos": {"x": 6, "y": 22, "w": 6, "h": 4},
"targets": [
{
"expr": "container_memory_usage_bytes{name=\"immich_machine_learning\"} / 1024 / 1024",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "decmbytes",
"color": {"mode": "thresholds"},
"thresholds": {
"mode": "absolute",
"steps": [
{"value": null, "color": "green"},
{"value": 4096, "color": "yellow"},
{"value": 8192, "color": "red"}
]
}
}
},
"options": {
"colorMode": "background",
"graphMode": "area",
"orientation": "auto"
}
},
{
"id": 9,
"title": "immich_machine_learning - 網路流量(接收)",
"type": "stat",
"gridPos": {"x": 12, "y": 22, "w": 6, "h": 4},
"targets": [
{
"expr": "rate(container_network_receive_bytes_total{name=\"immich_machine_learning\"}[5m]) / 1024",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "KBs",
"color": {"mode": "palette-classic"}
}
},
"options": {
"colorMode": "value",
"graphMode": "area",
"orientation": "auto"
}
},
{
"id": 10,
"title": "immich_machine_learning - 網路流量(傳送)",
"type": "stat",
"gridPos": {"x": 18, "y": 22, "w": 6, "h": 4},
"targets": [
{
"expr": "rate(container_network_transmit_bytes_total{name=\"immich_machine_learning\"}[5m]) / 1024",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"unit": "KBs",
"color": {"mode": "palette-classic"}
}
},
"options": {
"colorMode": "value",
"graphMode": "area",
"orientation": "auto"
}
},
{
"id": 11,
"title": "⚠️ API Metrics 說明",
"type": "text",
"gridPos": {"x": 0, "y": 26, "w": 24, "h": 6},
"options": {
"mode": "markdown",
"content": "## 📊 API Request Metrics 設定說明\n\n目前 **immich_machine_learning** 容器沒有暴露 Prometheus metrics endpoint。\n\n### 方案一:啟用 immich 內建 metrics(推薦)\n\n如果 immich 支援 metrics,需要在容器配置中啟用:\n\n```yaml\nenvironment:\n - METRICS_ENABLED=true\n - METRICS_PORT=3003\n```\n\n然後在 Prometheus 添加抓取目標。\n\n### 方案二:從日誌解析 API metrics\n\n如果 immich 會輸出 API request 日誌,可以使用 **Loki** 查詢統計:\n\n```logql\n# API 請求數量(每分鐘)\nsum(rate({container=\"immich_machine_learning\"} |= \"GET\" or |= \"POST\" [1m]))\n\n# API Latency(如果日誌包含響應時間)\navg_over_time({container=\"immich_machine_learning\"} | json | __error__=\"\" | unwrap response_time [5m])\n```\n\n### 方案三:使用 Prometheus Pushgateway\n\n如果可以修改 immich 程式碼,可以在應用內使用 Prometheus client library 推送 metrics。\n\n---\n\n**檢查日誌格式**:\n```bash\ndocker logs immich_machine_learning | grep -E \"(GET|POST|api)\"\n```\n\n如果看到 API request 日誌,可以建立 Loki 查詢來統計 request 數量和 latency。"
}
}
]
},
"overwrite": true
}