The Two Shepherds: On the Contrasting Vigils of Push and Pull
There is a quiet, fundamental schism in how our systems report their state, a philosophical divide in how they confess their health and their faults. It is the difference between a shout in the dark and a whispered question answered. In the realm of monitoring and metrics, we are tended to by two very different shepherds: one who listens for cries, and one who goes out, lantern in hand, to count the flock.
The first is the Push shepherd. This is the agent installed on the server, the conscientious scribe who feels a spike in memory usage or a failed connection and immediately composes a message. It bundles this metric—this urgent or not-so-urgent truth—and sends it out into the night, towards a known destination like StatsD or a metrics gateway. Its vigil is one of proactive declaration. It does not wait to be asked. It speaks because it must, because the event itself is the trigger. There is a certain drama to this approach; the system is in a constant state of testimony, and our collection service had better be listening.
The second is the Pull shepherd. This is the figure who walks the fields at a steady, unyielding rhythm. This is the Prometheus server, whose entire world is built on a simple, relentless question: "What is your state?" It makes its rounds, scraping metrics from pre-defined endpoints on each service. The services themselves are passive, almost monastic in their silence. They do not speak unless spoken to. They simply maintain a ledger of their current condition, a page that is read each time the shepherd passes by.
The contrast in character is profound. Push is event-driven, a stream of consciousness that can flood the gates during a crisis. It feels immediate and detailed, but it demands a resilient and scalable receiver; if the collector fails, the shouts are lost to the void. Pull, by comparison, is the essence of stability. It is a ritual. Even if a service is dying, it will often still present its last state to the shepherd on its final round, leaving a coherent, if tragic, record. The control is centralized, and the failure mode is clearer: if the shepherd disappears, the silence is instantly known.
Neither approach is inherently superior; they are simply different kinds of watchfulness. Push is the nervous system, firing signals at the first sign of heat or pressure. Pull is the steady pulse check, a methodical confirmation of life at regular intervals. One is a monologue, the other a dialogue. In our own architectures, we often employ both, understanding that some truths are best cried out, while others are best discovered in the quiet, repeated act of asking.
Notes & further reading
A few pages I came back to while writing this: