Course contentsShow
← System Design
Lesson 1181 of 1,91930. Observability: MetricsFree lesson

Push vs Pull Collection Models

Learn the tradeoffs between systems that push metrics to collectors versus those that scrape endpoints.

Push vs Pull Collection Models

What you'll learn: You'll understand the two fundamental ways metrics can be collected from services—pushing data to a central collector versus having a collector scrape endpoints—and when to use each approach.


The Two Approaches

When gathering metrics from distributed services, you have two architectural choices:

Push Model: Services actively send their metrics to a central collection service at regular intervals. Think of it like students emailing homework to a teacher as soon as it's done.

Pull Model: A central collector periodically reaches out to each service and scrapes (fetches) metrics from exposed endpoints. Like a teacher walking around the classroom collecting assignments from each desk.


Push Model: Pros and Cons

Advantages:

  • Services control when and how often they send metrics
  • Works well behind firewalls or NAT (collector doesn't need to reach services)
  • Simpler networking—only outbound connections needed
  • Good for short-lived jobs that may not exist when a scraper arrives

Disadvantages:

  • Collector must accept metrics from any service (authentication complexity)
  • Harder to detect if a service dies (no heartbeat mechanism)
  • Services need to know collector address (tighter coupling)
  • More load on collector during traffic spikes

Pull Model: Pros and Cons

Advantages:

  • Collector controls scrape frequency and configuration centrally
  • Easy to detect dead services (failed scrape = problem)
  • Services don't need to know about collectors (loose coupling)
  • Better for debugging—you can manually query service endpoints

Disadvantages:

  • Requires network reachability to all services
  • Discovery mechanism needed (how does collector know what to scrape?)
  • Short-lived jobs may finish before next scrape
  • Scraping many services can be resource-intensive

Key Takeaway: Push models give services control and work well in restrictive networks, while pull models centralize control and simplify service discovery—choose based on your network topology, service lifetime, and operational preferences. Many systems (like Prometheus) favor pull, while others (like StatsD) favor push.