You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Metrics are the foundation of observability. They are numeric measurements collected at regular intervals and stored as time series — sequences of data points indexed by time. Metrics are lightweight, efficient to store, and ideal for dashboards and alerting.
A time series is a sequence of values recorded at successive points in time:
timestamp value
2025-03-15T10:00:00Z 0.42
2025-03-15T10:00:15Z 0.51
2025-03-15T10:00:30Z 0.38
2025-03-15T10:00:45Z 0.67
Each time series is uniquely identified by a metric name and a set of labels (also called tags or dimensions):
http_request_duration_seconds{service="api", method="GET", endpoint="/users"}
Most metrics systems define four core metric types:
A monotonically increasing value that only goes up (or resets to zero on restart).
http_requests_total{method="GET", status="200"} 14523
Use counters for: total requests, errors, bytes transferred.
A value that can go up or down — a snapshot of a current measurement.
temperature_celsius{location="server-room"} 22.5
Use gauges for: CPU usage, memory usage, queue depth, temperature.
Samples observations (e.g., request latency) and counts them in configurable buckets.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.