Prometheus Pushgateway: The Push Model for Short-Lived Jobs
71%
When Is the Pushgateway Needed?
Prometheus Pushgateway is a metrics cache for Prometheus. It allows you to push metrics from jobs that cannot be scraped due to their short-lived nature: batch jobs, cron jobs, or ephemeral jobs.
Some examples include:
- A cron job that runs once a day and generates a report.
- A batch job that runs once a week and processes a large amount of data.
- A triggered service that runs randomly for a short period of time and generates metrics, then exits.
These jobs may run, finish, and disappear before Prometheus scrapes them. Even if the scrape interval is too short, we can never guarantee that Prometheus will scrape the job before it finishes. In these cases, the Pushgateway acts as an intermediary that holds the metrics until Prometheus scrapes them.
- The job runs and pushes its metrics to the Pushgateway.
- The Pushgateway stores the metrics in its internal memory.
Observability with Prometheus and Grafana
A Complete Hands-On Guide to Operational Clarity in Cloud-Native SystemsEnroll now to unlock all content and receive all future updates for free.
