Monitoring with Prometheus
Prometheus collects metrics from targets at regular intervals and stores them in a time-series database.
Key Concepts
- Metrics: Counter, Gauge, Histogram, Summary
- Labels: Key-value pairs to dimension metrics
- PromQL: The query language for alerting and dashboards
Example Query
rate(http_requests_total[5m]) > 100
Alerts fire when the 5-minute request rate exceeds 100 per second.
Start with four metrics: request rate, error rate, latency, and saturation.