Codele / System design
Monitoring and logs
You want to learn something is broken before your users tell you. Logs, metrics and alerts are how a system speaks up.
- A log is a diary of events a program writes down. Logs tell you why something broke.
- A metric is a number measured over time, like the error rate each minute. Metrics tell you that something is wrong.
- An alert is a rule on a metric, like “errors above 5 percent for two minutes”. It tells a person without them watching a screen.
- A rollback goes back to the last good version. It is often the fastest fix while you look for the real bug.
- Alerts need care: too sensitive and people ignore them, too slow and users suffer first.
Loading the playable lesson…