prometheus-pushgateway
A metrics cache that lets ephemeral jobs and batch processes push metrics to Prometheus.
What is prometheus-pushgateway?
The Prometheus Pushgateway image packages the Pushgateway component from the Prometheus ecosystem. Unlike long-running services that expose metrics endpoints for Prometheus to scrape, short-lived jobs (such as batch tasks or CI/CD steps) cannot easily be scraped once they complete. The Pushgateway solves this problem by allowing those jobs to push metrics to a gateway service, which Prometheus can then scrape.
This makes it particularly useful for monitoring outcomes of jobs that do not run continuously but still produce important metrics, like data processing tasks, build pipelines, or backup jobs.
However, the Pushgateway is not intended as a general metrics ingestion pipeline; it should be used selectively to avoid misrepresenting metrics lifetimes.
How to use this image
The Prometheus Pushgateway image can be run as a standalone container and then configured as a scrape target in Prometheus.
Examples:
<code># Run Pushgateway on port 9091
docker run -d -p 9091:9091 prom/pushgateway</code>
<code># Push a metric using curl
echo "my_job_metric 1" | curl --data-binary @- <http://localhost:9091/metrics/job/myjob></code>
<code><pre># Configure Prometheus to scrape Pushgateway
scrape_configs:
- job_name: 'pushgateway'
static_configs:
- targets: ['pushgateway:9091']</pre></code>
Image variants
The Prometheus Pushgateway image is published under prom/pushgateway
with the following forms:
prom/pushgateway:<version>
Version-pinned images (e.g., prom/pushgateway:v1.10.0
) recommended for production to ensure reproducibility.
prom/pushgateway:latest
Tracks the most recent stable release. Useful for evaluation but not ideal for production.
prom/pushgateway:master
Built from the latest commits in the master branch. Intended for contributors or teams testing new features.