FILE: materi-24.module

Monitoring dengan Prometheus dan Grafana

Observability layer 1 metrics. Time-series data, alerting, dashboards.

RUNTIME: 26m LEVEL: intermediate STATUS: ACTIVE
> MONITORING $ Prometheus Grafana stack [OK] Module loaded successfully [INFO] Ready for next stage

1. Mengapa Monitoring

Tidak bisa improve apa yang tidak diukur. Production tanpa monitoring = blind. Detect issue sebelum customer complain. Capacity planning. Performance optimization. Compliance.

2. Prometheus

Time-series database open source. Pull-based: scrape metric endpoint /metrics. Multidimensional dengan label. Query language PromQL powerful. Lahir dari SoundCloud, kini di CNCF.

3. Grafana

Visualization tool untuk Prometheus dan banyak source lain. Dashboard customizable. Library template ribuan. Alerting integrate dengan PagerDuty, Slack. UI bagus dan profesional.

4. 4 Golden Signals

Latency (durasi request). Traffic (request per second). Errors (rate of failure). Saturation (resource fullness). Dari Google SRE book. Cover 80 persen monitoring needs.

5. Alerting

Define rule: if metric exceed threshold, alert. Alert routing ke team yang tepat. Severity level. Avoid alert fatigue (alasin yang penting saja). Runbook untuk setiap alert.

Practical Mission

  1. Setup Prometheus dan Grafana di local
  2. Build dashboard untuk app
  3. Define alert rule sederhana
  4. Pelajari PromQL tutorial
  5. Setup alert ke email atau Slack

Recap Module