Alert-Driven Dashboard Philosophy
對照 Google SRE 的設計理念。Dashboard 不是用來「常駐盯盤」的,而是 alert 觸發後的 triage surface ——目的是讓 on-call 在 30 秒內找到問題位置與影響範圍。
設計順序:先 alert → 進 dashboard 看 → 資訊要能立刻找到問題
一、設計三原則
| 原則 | 說明 |
|---|---|
| 1. Alert first | Dashboard 的入口是 alert,不是「打開來看」。所以 dashboard 第一眼必須回答「在燒嗎?燒在哪?」 |
| 2. Triage on entry | Alert 進來後第一層必須是紅綠燈式總覽;下一層才是 drill-down |
| 3. Fast comprehension | 第一層的訊號越少越獨立越好;第二層只在「真的有問題」時呈現資訊 |
二、第一層 stat row 的設計
2.1 訊號必須互相獨立 (orthogonal)
第一排每個 stat 應該回答不同類別的問題。如果兩個 stat 訊號高度相關, 那其中一個就是 noise,不該佔黃金位置。
| 問題類別 | Stat |
|---|---|
| 服務還在嗎? | Service Up / Ready Replicas Ratio |
| 服務在發錯嗎? | Error Rate (5xx) |
| 服務慢嗎? | Latency p95, p99 |
| 有人用嗎 / 流量正常嗎? | Traffic vs Baseline (今天 vs 一小時前 / 一週前) |
2.2 訊號要雙向警報
例如 traffic:
- 流量太低 → 可能 ingress / DNS / 上游壞了(5xx 抓不到,因為「沒有請求 = 沒錯誤」)
- 流量太高 → 可能 retry storm / bot / loop bug(latency 抓得到但較慢)
只看「太高」是 capacity dashboard 的設計,不是 alert→triage dashboard 的設計。 on-call 入口面板寧可保守警報,誤報 1 次比漏看 1 次重要。
2.3 Service Up 必須獨立於 5xx / latency
當服務全 down 時:
- Error rate = 0%(沒請求 = 沒錯誤)
- Latency = N/A(沒資料)
- 只有 Service Up 能告訴你「真的全壞了」
這個 case 是 alert→triage dashboard 最常被忽略的盲區。
三、第二層的設計:「沒事就空白」
第一層回答「在燒嗎」,第二層必須回答「燒在哪」。第二層的 panel 在沒問題時應該完全空白。
| 第二層需求 | 推薦 panel 類型 |
|---|---|
| 列出有問題的東西 | Instant table + PromQL > 0 過濾 + cell coloring |
| 看趨勢、看相關性 | timeseries + topk(N) > 0 |
| 摘要紅綠燈 | stat(series 不會多) |
3.1 為什麼用 instant table 而不是 stat panel 列問題?
Stat panel 多 series 會爆:10 region × 3 個壞 pod = 30 個小格子, 字小到看不清,全部紅燈反而失去資訊。
Table 才是業界正解(Kubernetes Dashboard、k9s、ArgoCD 都用 table):
- 每個問題一行
- 排序可控
- 用 cell coloring 表示嚴重度
- PromQL 端先
> 0過濾、empty 時整張表空白
3.2 為什麼不放原始 path / per-instance 訊號在第一層?
path、pod、instance 這類 label 是高 cardinality:
- 每個 URL / pod 一條 series → query 成本高、legend 雜亂
- 低流量 path 的 p99 容易抖動且誤導
正確分層:
- 第一層 stat / alert:用 aggregated 訊號(
route_group, deployment) - 第二層 drill-down:才看 raw
path, rawpod
四、跟 Google SRE 的對照
4.1 對齊的部分
Four Golden Signals
(SRE Book ch.6 — Monitoring Distributed Systems)
"If you can only measure four metrics of your user-facing system, focus on these: latency, traffic, errors, saturation."
對應一般 alert→triage dashboard:
| Google Golden Signal | 一般做法 |
|---|---|
| Latency | p95 / p99 stat |
| Traffic | Traffic vs Baseline stat(雙向) |
| Errors | Error Rate stat |
| Saturation | CPU/memory utilization vs limit |
Alert-driven workflow
(SRE Workbook ch.5 — Alerting on SLOs)
"Good SLOs that measure the reliability of your platform, as experienced by your customers, provide the highest-quality indication for when an on-call engineer should respond."
→ Dashboard 是 alert 的延伸,不是反過來。
Noise reduction
"Effective alerting systems have good signal and very low noise."
→ 「沒事就空白」 = 把 noise 在 query 層就過濾掉。
Progressive disclosure
"Lead with high-level SLO charts and drill down to per-service, per-endpoint, per-pod details."
→ Row 結構:CUJ → Traffic / Loading → App Resource → Service Health。