# Metric (Monitoring)

> A number about a system, kept over time. You can draw it as a chart.

**Field:** Infrastructure  
**Category:** Monitoring & Observability  
**Also known as:** Metrics, System Metric, Time Series Metric, Monitoring Metric

## Think of it like

It is like a step counter. It keeps one number, and you can see how it changes over the day.

## Definition

A metric is a number about a system, measured again and again over time. Examples are requests per second, error count or memory in use. Each reading is saved with its time, so the numbers form a line you can chart. Metrics are small and cheap, so you can keep them for months. They show trends and limits well, but not the story of one request.

## Example

Lucy's error-rate metric sits near 0.1% all week. On Friday it jumps to 4% one minute after a new release, so she rolls it back.

## Example code

```prometheus
# TYPE http_requests_total counter
http_requests_total{method="post",code="200"} 1027
http_requests_total{method="post",code="400"} 3
```

One counter split by labels. The app has answered 1,027 good posts and 3 bad ones so far.

## Why it matters

Metrics are what dashboards and alerts are built on. They show at a glance whether things are normal.

## Common mistake

Adding a label with endless values, like a user ID. Each value makes a new line, and the store slows to a crawl.

## Three principles

- **A number over time.** Each reading keeps its timestamp.
- **Cheap to keep.** Small enough to store for months.
- **Labels split it.** Tags like method or status code.

## Related terms

- [Monitoring](https://learn.benibix.com/term/infrastructure/monitoring)
- [Alerting](https://learn.benibix.com/term/infrastructure/alerting)
- [Prometheus](https://learn.benibix.com/term/infrastructure/prometheus)
- [Grafana](https://learn.benibix.com/term/infrastructure/grafana)
- [Latency](https://learn.benibix.com/term/infrastructure/latency)
- [Throughput](https://learn.benibix.com/term/infrastructure/throughput)
- [KPI Dashboard](https://learn.benibix.com/term/business/kpi-dashboard)

![Three panels side by side about the same slow request. Logs: three lines of text, each with a time and a message, the last one an error. Metrics: a line chart of response time over an hour, with a spike. Traces: a set of stacked bars, one per step of the request, where the database bar is the longest.](https://learn.benibix.com/diagrams/inf-telemetry-signals.svg)

---

Source: https://learn.benibix.com/term/infrastructure/metric
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
