Skip to main content
This guide explains how to install Prometheus Pushgateway, run it as a service, and configure Prometheus to scrape it. Pushgateway is useful when ephemeral or batch jobs need to push metrics for Prometheus to collect later.

Prerequisites

  • A Linux host (or another OS) with network access from your Prometheus server.
  • wget or curl for downloading the release.
  • systemd (recommended) if you want Pushgateway to run as a managed service.
Download the Pushgateway binary from the official GitHub releases page: https://github.com/prometheus/pushgateway/releases. Releases include prebuilt binaries for Darwin, Linux, and Windows.
A screenshot of the Prometheus "pushgateway" download page showing version 1.4.3. It displays a table of downloadable files for Darwin, Linux and Windows with file sizes and SHA256 checksums.

Quick install and test (Linux example)

  1. Download and extract the release (example: v1.4.3, Linux amd64):
  1. Start Pushgateway directly for a quick smoke test (listens on port 9091 by default):
  1. Verify the metrics endpoint that Prometheus will scrape:
Example trimmed output:
Running Pushgateway under systemd makes it easier to manage, restart on failure, and control permissions.
  1. Create a dedicated system user and copy the binary:
  1. Create the systemd unit file /etc/systemd/system/pushgateway.service with the following content:
  1. Reload systemd, start, enable, and check status:
If your host has a firewall, allow port 9091 or configure your firewall rules accordingly.
When exposing Pushgateway, ensure only trusted processes can push metrics. The Pushgateway accepts pushed metrics and preserves labels; untrusted pushers may inject or overwrite labels. Use network controls and authentication where necessary.

Common commands reference

Configure Prometheus to scrape Pushgateway

Add a scrape job to your prometheus.yml. The key setting is honor_labels: true. Many jobs that push metrics to Pushgateway include their own job and instance labels; by default Prometheus would overwrite those labels with the scrape job’s labels. honor_labels: true preserves the labels provided by pushers. Example prometheus.yml snippet:
Setting honor_labels: true ensures metrics pushed to the Pushgateway retain the original labels (for example job and instance) provided by the pushing jobs rather than being overwritten by the scrape job’s labels.
With this configuration:
  • Multiple jobs can push metrics to the Pushgateway and set identifying labels.
  • Prometheus will scrape the Pushgateway and preserve those label values, allowing metrics to reflect their true source.

Troubleshooting & tips

  • If metrics appear missing or labels are different than expected, check that the clients pushing metrics set the labels as intended and that honor_labels is enabled.
  • If Pushgateway fails to start under systemd, inspect journalctl -u pushgateway for logs.
  • For secure or multi-tenant setups, consider using network-level controls, authentication proxies, or restricting who can push metrics.

Watch Video