Metrics are numeric measurements collected over time to describe the state or behavior of a system.
Common metrics include:
- CPU usage
- Memory usage
- Request rate
- Error rate
- Latency
- Queue depth
Metrics are useful because they are compact, easy to graph, and good for spotting trends or anomalies at a glance.
How they differ from logging and traces
Metrics answer “how much” or “how often”.
- Logging answers “what happened”
- Traces answer “where did this request go”
- Metrics answer “how is the system behaving overall”
Related tools
Prometheus is commonly used to collect and store metrics, and Grafana is commonly used to visualize them.
Compare
Metrics are one of the three main signals in Observability.