← Lessons

quiz vs the machine

Gold1370

System Design

The Push Gateway Pattern

Bridging short lived jobs into a pull based metrics world.

4 min read · core · beat Gold to climb

The gap pull leaves

A pull based server scrapes long running targets, but a short lived batch job may start and finish between scrapes, so its metrics are never read. The push gateway pattern bridges this gap.

How it works

  • The batch job pushes its final metrics to the gateway before exiting.
  • The gateway holds the most recent pushed values.
  • The metrics server scrapes the gateway like any other target.

The job is decoupled from scrape timing; the gateway becomes a durable place its last values live.

Use it sparingly

The gateway is meant for service level batch jobs, not for turning the whole system into a push pipeline.

  • It does not track liveness of the original job.
  • Stale values persist until explicitly deleted, so old jobs can linger.
  • Group by a job identity so pushes overwrite cleanly.

Key idea

A push gateway lets short lived jobs push final metrics to a holding endpoint the server scrapes, bridging ephemeral work into a pull model without overusing push.

Check yourself

Answer to earn rating on the learn ladder.

1. What problem does the push gateway solve?

2. What is a caution when using a push gateway?