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.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Prometheus Architecture