Feedback

Chat Icon

Observability with Prometheus and Grafana

A Complete Hands-On Guide to Operational Clarity in Cloud-Native Systems

Prometheus Pushgateway: The Push Model for Short-Lived Jobs
72%

Configuring the Pushgateway

The Pushgateway is available as a Golang binary, which can be downloaded from GitHub. You can also deploy it as a Docker container. In this guide, we will create a systemd service to run it as a daemon.

We are going to install the Pushgateway on the same server as Prometheus (monitoring server). Start by downloading the Pushgateway binary, adding a new user, and creating a systemd service.

# Download the Pushgateway from GitHub
cd $HOME
url="https://github.com/prometheus/pushgateway/releases/download/v1.11.2/pushgateway-1.11.2.linux-amd64.tar.gz"
wget $url
tar -xvf pushgateway-1.11.2.linux-amd64.tar.gz
cd pushgateway-1.11.2.linux-amd64

# Create a new user for the Pushgateway
useradd --no-create-home --shell /bin/false pushgateway

# Copy the Pushgateway binary to /usr/local/bin
cp pushgateway /usr/local/bin/pushgateway
chown pushgateway:pushgateway /usr/local/bin/pushgateway

# Create the systemd unit file
cat < /etc/systemd/system/pushgateway.service
[Unit]
Description=Prometheus Pushgateway
Wants=network-online.target
After=network-online.target

[Service]

Observability with Prometheus and Grafana

A Complete Hands-On Guide to Operational Clarity in Cloud-Native Systems

Enroll now to unlock all content and receive all future updates for free.