บทเรียนที่ 1ตัวบ่งชี้ Error และ Saturation: อัตรา 4xx/5xx, error budget burn (http_requests_total{code=~"5.."})เรียนรู้วิธีการตรวจสอบ HTTP errors และ saturation โดยใช้ Prometheus คุณจะ map อัตรา 4xx และ 5xx คำนวณ error budget burn และออกแบบแจ้งเตือนที่แยกปัญหาลูกค้าจากความล้มเหลวของเซิร์ฟเวอร์และอาการ overload
Tracking 4xx vs 5xx error rate time seriesUsing http_requests_total with code labelCalculating error budget burn from SLOsDetecting saturation via queue and retry metricsAlerting on fast vs slow error budget burnบทเรียนที่ 2เมตริก PostgreSQL: connections, active queries, transaction commits/rollbacks, replication lag (pg_stat_activity count, pg_stat_database_xact_commit, pg_stat_replication)สำรวจเมตริก PostgreSQL สำคัญที่ expose ให้ Prometheus คุณจะติดตาม connections, active queries, พฤติกรรม transaction และ replication lag เพื่อตรวจจับ overload, blocking และความเสี่ยง failover ในคลัสเตอร์ฐานข้อมูลการผลิต
Monitoring connection counts and limitsActive query tracking with pg_stat_activityTransaction commit and rollback metricsMeasuring replication lag and replay delayAlerting on blocked and long running queriesบทเรียนที่ 3เมตริก Storage และ Disk: disk I/O ops, disk latency, filesystem utilization (node_disk_io_time_seconds_total, node_disk_io_time_seconds)ทำความเข้าใจเมตริก storage และ disk ที่ส่งผลต่อความน่าเชื่อถือ คุณจะตรวจสอบ disk I/O operations, latency และ filesystem utilization เพื่อตรวจจับ saturation, อุปกรณ์ที่ล้มเหลว และความเสี่ยง capacity ในโหนดสำคัญ
Disk IOPS and throughput time seriesnode_disk_io_time_seconds interpretationRead and write latency percentilesFilesystem utilization and inode usageAlerting on disk saturation and failuresบทเรียนที่ 4เมตริกทรัพยากรสำหรับ pods และ nodes: CPU, memory, filesystem, ephemeral storage (container_cpu_usage_seconds_total, container_memory_usage_bytes, node_filesystem_avail_bytes)เรียนรู้ว่าเมตริกทรัพยากร pod และ node ใดที่สำคัญที่สุด คุณจะตรวจสอบ CPU, memory, filesystem และ ephemeral storage usage เพื่อตรวจจับ throttling, out of memory kills และ disk pressure ก่อนกระทบผู้ใช้
container_cpu_usage_seconds_total patternsMemory usage and working set metricsDetecting OOM kills and memory pressureFilesystem and ephemeral storage usageAlerting on CPU throttling and saturationบทเรียนที่ 5เมตริกประสิทธิภาพฐานข้อมูล: query duration histograms, cache hit ratio, locks และ waiting queries (pg_stat_statements และ postgres_exporter metrics)ตรวจสอบเมตริกประสิทธิภาพฐานข้อมูลที่ export ให้ Prometheus คุณจะใช้ query duration histograms, cache hit ratios และ lock metrics เพื่อค้นหา slow queries, contention hotspots และ execution plans ที่ไม่มีประสิทธิภาพ
Query duration histograms and bucketspg_stat_statements latency and frequencyCache hit ratio and buffer usage metricsLock wait time and blocked query countsAlerting on regressions in query performanceบทเรียนที่ 6Kubernetes control-plane และ pod health: pod restarts, crashloop count, pod_ready, kube_pod_status_phaseเรียนรู้ว่าเมตริกใดบ่งชี้ Kubernetes control-plane และ pod health คุณจะตรวจสอบ pod restarts, CrashLoopBackOff patterns, readiness และ phase transitions เพื่อระบุ workload ที่ไม่เสถียรและโหนดที่ล้มเหลวอย่างรวดเร็ว
Tracking pod restarts and crashloop countsUsing kube_pod_status_phase for pod lifecycleReadiness and liveness probe failure metricsCorrelating pod health with node conditionsAlerting on unstable or frequently restarting podsบทเรียนที่ 7เมตริก HTTP service: request rate, status codes, client latency (http_requests_total, http_request_duration_seconds_bucket, http_request_duration_seconds_sum/count)เน้นเมตริก HTTP service ที่อธิบาย traffic และ user impact คุณจะติดตาม request rate, status codes และ latency distributions เพื่อสร้าง SLOs, ตรวจจับ incidents และปรับจูนประสิทธิภาพแอปพลิเคชัน
http_requests_total labels and dimensionsRequest rate and concurrency estimationLatency histograms and summary metricsSeparating client and server error codesBuilding SLOs from HTTP latency metricsบทเรียนที่ 8เมตริก Network และ Load: service request success rate, network latency, service_endpoint latency (service:request_latency_bucket)ศึกษเมตริก network และ load ที่อธิบาย service health คุณจะติดตาม request success rate, network latency และ endpoint level histograms เพื่อตรวจจับ partial outages, noisy neighbors และ overloaded services
Service level request success rate metricsMeasuring network and TLS handshake latencyUsing service:request_latency_bucket histogramsDetecting partial regional or zone outagesAlerting on tail latency and saturationบทเรียนที่ 9Kube-state-metrics เฉพาะ: deployments desired vs available replicas, daemonset/pod disruption budgets, PVC capacity และ usageเจาะลึก kube-state-metrics และ Kubernetes objects ระดับสูง คุณจะตรวจสอบ desired versus available replicas, disruption budgets และ persistent volume claims เพื่อให้มั่นใจใน capacity, resilience และ safe rollouts
Deployment desired vs available replicasDaemonSet and StatefulSet readiness metricsPodDisruptionBudget allowed disruptionsPVC capacity, usage, and bound statusAlerting on under replicated workloadsบทเรียนที่ 10เมตริก Scheduler และ Controller: kube_scheduler_schedule_attempts_total, kube_controller_manager_workqueue_depthทำความเข้าใจเมตริก scheduler และ controller ที่เผยพฤติกรรม Kubernetes control คุณจะใช้ Prometheus ติดตาม scheduling attempts, queue depth และ reconcile loops เพื่อตรวจจับ bottlenecks และ control-plane stress
kube_scheduler_schedule_attempts_total usageInterpreting scheduling error and failure labelsWorkqueue depth and processing rate metricsDetecting controller backlogs and slow reconcilesAlerting on stuck or flapping controllers