What Are Metrics and Why They Matter
You'll learn: What metrics are as a core observability pillar and why they're essential for understanding system health.
What Are Metrics?
Metrics are numerical measurements that capture system behavior over time. Think of them like the vital signs doctors track for your health—heart rate, blood pressure, temperature. For distributed systems, metrics are counters, gauges, histograms, and timers that tell you how your system is performing at any moment.
Unlike logs (which capture discrete events) or traces (which follow individual requests), metrics provide aggregated, time-series data that reveals trends and patterns:
- Counters: Total HTTP requests served (always increasing)
- Gauges: Current memory usage (fluctuates up and down)
- Histograms: Request latency distribution (buckets of response times)
- Timers: How long operations take
Why Metrics Matter
Metrics are your early warning system. They answer critical questions instantly:
- Is traffic spiking? (requests per second)
- Are errors increasing? (error rate)
- Is the system slowing down? (p99 latency)
- Are resources exhausted? (CPU, memory, disk usage)
The key advantage: Metrics are cheap to collect, store, and query. While storing every single log line for a billion requests is expensive, recording that "we served 1 billion requests with 0.5% errors" is trivial. This makes metrics ideal for dashboards, alerting, and long-term trend analysis.
Metrics enable proactive monitoring—you spot problems before users complain, not after your log aggregator crashes under load.
Key Takeaway:
Metrics are lightweight, aggregated numerical measurements that provide real-time visibility into system health, making them essential for monitoring, alerting, and capacity planning in distributed systems.