What is the Pushgateway and when should you use it?
IntermediateConceptPrometheus Architecture
Answer
The Pushgateway is a metrics cache that short-lived batch jobs push to, and Prometheus scrapes it. Use it only for service-level batch jobs that finish before a scrape could happen (nightly backup, cron job).
echo "backup_last_success_timestamp_seconds $(date +%s)" | \
curl --data-binary @- http://pushgateway:9091/metrics/job/db_backup
Scrape it with honor_labels: true so the pushed job label is kept.
More on Prometheus Architecture
Describe the Prometheus architecture.BeginnerWhat does a basic prometheus.yml look like?BeginnerWhat is the `up` metric?BeginnerWhat are `job` and `instance` labels and where do they come from?BeginnerHow is the Prometheus TSDB organized on disk?AdvancedWhat is the WAL and why does Prometheus restart slowly sometimes?Advanced