Pull vs Push Metrics Collection
Compare metrics collection where the server scrapes targets with collection where targets send data.
| Dimension | Pull (Prometheus scrape) | Push (OTLP, remote write, StatsD) | What it means in practice |
|---|---|---|---|
| Who connects | The monitoring server connects to each target. | Each target connects to the collector. | Firewalls and NAT often decide which model is practical. |
| Target health | A failed scrape is itself a signal (up == 0). | Silence can mean down or just quiet; needs absent checks. | Pull gives liveness for free. |
| Short-lived jobs | May finish before being scraped; needs Pushgateway. | Sends results before exiting. | Use push for batch jobs and serverless functions. |
| Discovery | Needs service discovery to find targets. | Targets need the collector address. | Kubernetes service discovery makes pull simple in clusters. |
| Back pressure | The server controls scrape rate. | Senders can overload the collector. | Set rate limits and queues on push collectors. |
| Verification | Prometheus Status → Targets. | Collector receiver metrics (accepted/refused). | Check both ends when data is missing. |