Part 14 · Observability & Production Debugging
Part 14 / 14.4
Sai lầm và checklist production debugging
Telemetry chỉ có giá trị khi phản ánh user impact, dẫn đến hành động và vẫn an toàn về cardinality, chi phí, quyền truy cập cùng dữ liệu nhạy cảm.
Red flags
Alert mọi metric threshold nhưng không có SLO, owner, severity hoặc runbook.
Dùng request/user ID làm metric label; log secrets/PII để debug nhanh.
Dùng Grafana như nơi chứa logic duy nhất, tạo panel quá nặng hoặc chạy alert trùng với Prometheus mà không có ownership.
Nhìn một snapshot thread/heap/CPU rồi kết luận root cause.
Tăng Tomcat threads, DB pool, timeout hoặc retry mà không đo bottleneck downstream.
Restart/rollback liên tục nhưng không verify version, impact và hypothesis.
Postmortem quy lỗi cá nhân, action mơ hồ hoặc không có test hoàn thành.
Checklist
- Tôi phân biệt monitoring/observability và vai trò metrics/logs/traces/profiles.
- Tôi định nghĩa user-centric SLI, SLO, error budget và burn-rate alert.
- Tôi chọn metric types/buckets/labels, viết PromQL đúng counter reset và kiểm soát cardinality.
- Tôi thiết kế Grafana dashboard theo SLO/RED/USE, phân biệt NoData với zero và version-control provisioning.
- Tôi phân vai Prometheus rules, Alertmanager và Grafana-managed alert để tránh page trùng.
- Tôi thiết kế structured/audit logs có masking, access và retention.
- Tôi propagate trace context qua HTTP, messaging và executors.
- Tôi dùng JFR, GC evidence, thread/heap diagnostics theo rủi ro.
- Tôi hiểu Tomcat connector, queues, threads, graceful shutdown và pool interactions.
- Tôi điều tra dependency saturation, retry amplification và queue lag.
- Tôi vận hành incident theo roles, timeline, mitigation và verification.
- Tôi viết postmortem blameless với actions đo được.
Definition of Done
- Trả lời ít nhất 29/36 câu theo evidence chain.
- Hoàn thành ít nhất 6/8 lab, gồm JVM/Tomcat và incident game day.
- Có SLO/burn-rate alert, cardinality/privacy review và cross-signal investigation.
- Có runbook, incident timeline, postmortem và action verification.