Metrics: definition
Metrics are numeric measurements associated with time and contextual dimensions. They are efficient for trends, thresholds, rates and aggregate views of system behavior. Common examples include request count, error rate, CPU utilization, queue depth and latency distributions.
Common metric shapes
Telemetry systems distinguish different instrument types because the arithmetic that makes sense depends on what is measured. Counters represent values that accumulate, gauges represent current values, and histograms summarize distributions such as request duration or payload size.
Labels and dimensions
A metric becomes much more useful when it can be segmented by attributes such as service, route, region, environment or status class. The same flexibility creates a cardinality risk: unbounded labels such as user IDs or request IDs can produce an enormous number of unique time series.
Why percentiles matter for latency
Latency is a distribution. A histogram can preserve enough information to estimate percentiles, while a simple average can hide the slow tail. The exact aggregation and histogram configuration matter when comparing data across services or telemetry backends.
What metrics are good at
- Detecting trends and threshold crossings.
- Calculating rates and ratios over time windows.
- Aggregating many events efficiently.
- Driving dashboards, alerts and service-level indicators.
What metrics do not tell you by themselves
A metric can tell you that errors increased without preserving the full details of each error. Investigation often needs logs for event detail or traces for request paths. Good observability links those signal types instead of expecting one to replace the others.
Related concepts
Short answer
Metrics are time-oriented numeric measurements. Choose instrument types that match the data, keep labels bounded, and use distributions for values such as latency where an average can hide important behavior.
Practical checklist
- Choose counters, gauges or histograms that match the measurement.
- Keep label values bounded to avoid runaway cardinality.
- Use histograms or distributions for latency-like values.
- Link alerting metrics to logs or traces for diagnosis.
A metric should answer a repeatable question
Before adding a metric, write the operational question it supports and the labels needed to segment the answer. Avoid labels with unbounded user, request or URL values. For latency, histogram-style data is usually more useful than a single average because it preserves the distribution responders need to inspect.