← Lessons

quiz vs the machine

Gold1400

System Design

The Prometheus Pull Model

Why a server scrapes targets rather than receiving pushed metrics.

5 min read · core · beat Gold to climb

Pulling instead of pushing

In the pull model the metrics server periodically scrapes an HTTP endpoint exposed by each target. The target just publishes its current metrics, and the server decides when to read them.

How a scrape works

  • Service discovery gives the server a list of targets.
  • On each scrape interval the server fetches the metrics endpoint.
  • It parses the text exposition format into series and stores them.
  • A synthetic up metric records whether the scrape succeeded.

Why pull is attractive

  • The server controls the rate, avoiding floods from misbehaving clients.
  • Target health is visible directly through scrape success.
  • Targets need no knowledge of the storage backend.

Limits

  • Targets must be reachable by the server, which is awkward for short lived jobs or hosts behind firewalls.
  • Very brief batch jobs may finish before any scrape, which motivates a push gateway.

Key idea

The pull model has the server scrape target endpoints on its own schedule, giving rate control and built in health visibility at the cost of reachability.

Check yourself

Answer to earn rating on the learn ladder.

1. In the pull model, who initiates data transfer?

2. What benefit does the server controlling the scrape rate provide?