Prometheus

Architecture & Pull-based Scraping

Understand why Prometheus pulls metrics over HTTP and how its single-node TSDB is laid out.

Prometheus is the de-facto open-source metrics system, a CNCF graduated project built around a pull model. Instead of services pushing data, the Prometheus server periodically scrapes an HTTP /metrics endpoint exposed by each target, fetching a plain-text exposition of current values. Targets are found via service discovery (Kubernetes, Consul, file-based) so the scrape list updates as the fleet changes.

A night watchman doing rounds: instead of every room calling in, the watchman visits each on a fixed schedule and notes the reading — and immediately knows if a room fails to answer the knock.

Key Concepts

1
Scraped samples land in a local time-series database on disk, optimised for append-heavy writes and compressed into blocks. A single Prometheus server is intentionally standalone and reliable — no clustering, no external dependencies — which makes it simple to run but means one server's data and retention are bounded by its disk. The pull model also gives a free health signal: if a scrape fails, the target's "up" metric goes to 0.