Course contentsShow
← Cloud and Infrastructure
Lesson 1948 of 2,98942. Observability - MetricsFree lesson

Time-Series Data Model

How Prometheus stores metrics as time-series with metric names, labels, timestamps, and float64 values.

Time-Series Data Model

What you'll learn: How Prometheus organizes and stores metrics as time-series data with unique identities and timestamped values.

What Is a Time-Series?

In Prometheus, every metric you collect becomes a time-series: a stream of timestamped measurements identified by a unique combination of a metric name and labels. Think of it like a spreadsheet where each row is a measurement at a specific moment, and the column headers tell you exactly what you're measuring.

The Four Components

Every time-series data point in Prometheus consists of:

  1. Metric name – What you're measuring (e.g., http_requests_total, cpu_usage_seconds)
  2. Labels – Key-value pairs that add dimensions (e.g., {method="GET", endpoint="/api/users"})
  3. Timestamp – When the measurement was taken (Unix timestamp, millisecond precision)
  4. Value – The actual measurement as a float64 (a 64-bit floating-point number)

How It Works Together

The metric name plus its unique label combination creates a time-series identifier. For example:

http_requests_total{method="GET", endpoint="/api/users"} 1234.0 @1609459200000
http_requests_total{method="POST", endpoint="/api/users"} 567.0 @1609459200000

These are two separate time-series even though they share the same metric name, because their labels differ. Each series tracks its own independent stream of values over time.

Why This Matters

This model allows Prometheus to efficiently store millions of unique metrics while making it fast to query specific dimensions (like "all POST requests" or "requests to /api/users across all methods").

Key Takeaway: Prometheus stores metrics as time-series, where each unique metric name + label combination creates an independent stream of timestamped float64 values—enabling powerful, dimensional observability.