Metrics Fundamentals
Overview
Metrics provide numerical signals about system behavior over time, enabling trend analysis and alerting.
Metric Types
- Counter: cumulative increasing value
- Gauge: current measured value
- Histogram: distribution of observed values
- Summary: quantile-oriented distribution
flowchart LR
A[Application] --> B[Metric Endpoint]
B --> C[Collector]
C --> D[Time Series Store]
Practical Example
http_requests_total{service="orders",status="200"} 84521
request_duration_seconds_bucket{le="0.5"} 10234
Production Example
Teams monitor latency percentiles and error rates to detect degraded customer-facing behavior before outages.
Common Pitfalls
- High-cardinality labels causing storage pressure
- Tracking too many metrics without actionability
- Missing clear ownership for service-level indicators
Key Takeaways
- Metrics are foundational for proactive monitoring.
- Label design strongly affects metric scalability.
- Focus on signals tied to user and business impact.