Week 1: Monitoring Fundamentals — Prometheus
Theme: Understand Prometheus architecture, instrument applications, write PromQL queries.
Learning Objectives
- Explain Prometheus architecture (pull model, TSDB, service discovery, federation)
- Install and configure Prometheus using helm
- Instrument a Go HTTP server with Prometheus client library
- Write PromQL queries (rate, irate, histogram_quantile, aggregations)
Reading Materials
- Prometheus Overview
- Prometheus Architecture
- Prometheus Data Model
- PromQL Basics
- PromQL Operators
- Prometheus Best Practices
- Go Client Library Guide
- Google SRE Book - Chapter 6: Monitoring
Finger Exercises (choose 2)
- Install Prometheus via
helm installon a local kind/minikube cluster. Verify targets are up. - Write a simple Go HTTP server that exposes custom metrics (
http_requests_total,http_request_duration_secondshistogram). Scrape with Prometheus. - Practice 10 PromQL queries on the Prometheus demo instance at
demo.promlabs.com. Start withrate(promhttp_metric_handler_requests_total[5m])and work up tohistogram_quantile(0.95, ...).
Project
Build a Go HTTP server with /api/users, /api/orders, /healthz endpoints. Expose:
http_requests_total{method, endpoint, status}http_request_duration_seconds(histogram)- Custom
business_orders_created_total up/healthmetric
Deploy to kind, configure Prometheus scrape, verify in Prometheus UI.
Time Budget
| Activity | Time |
|---|---|
| Reading | 2 hrs |
| Finger exercises | 1.5 hrs |
| Project | 2.5 hrs |
| Total | 6 hrs |