L84 — Capstone: Deploy & Observe

Lesson cuối cùng của lộ trình. Ba mô phỏng tương tác: (1) Deploy pipeline — code → docker → k8s → pod chạy; (2) Observability dashboard — RED metrics + cache hit + queue depth live; (3) Load test — ramp req/s, xem p50/p99 + error rate, bottleneck lộ ra.

1 · Deploy Pipeline — code → docker → k8s → pods

Bấm Chạy pipeline để xem service URL Shortener đi từ source code, qua build image multi-stage, push registry, deploy Kubernetes, tới 3 pod chạy thật. Bấm Scale để HPA thêm pod khi tải tăng.

📝
Code
git push main
🧪
Test
go test (gate)
🐳
Docker
multi-stage ~12MB
📦
Push
ghcr.io :sha
☸️
K8s apply
rollout

2 · Observability Dashboard — RED + cache + queue (live)

Mô phỏng dashboard Grafana. Kéo thanh TảiCache TTL để xem RED metrics (Rate/Errors/Duration), cache hit ratio và queue depth phản ứng theo thời gian thực — đúng các metric trong observability.go.

Rate (req/s)
300
Error rate
0.1%
p99 latency
28ms
Cache hit
94%
Queue depth
12
Clicks/s
300

Latency p50 / p99 (ms)

Queue depth

3 · Load Test — ramp req/s, p50/p99, error, bottleneck

Bấm Chạy load test để ramp từ 100 → mục tiêu req/s. Chọn cấu hình chưa tối ưu (TTL ngắn, 1 worker) để thấy bottleneck lộ ra (p99 vọt, error tăng), rồi đã tối ưu để thấy before/after.

Throughput
p50
p99
Error rate

Tải bắn (req/s) theo thời gian — ramp