Prometheus Push Gateway (AWS EC2)
Setup Push gateway Binary:
Step 1: Download the latest Push Gateway package.
wget https://github.com/prometheus/pushgateway/releases/download/v1.4.2/pushgateway-1.4.2.linux-amd64.tar.gz
tar -xvf pushgateway-1.4.2.linux-amd64.tar.gz
Copy Push Gateway file into binary and change the ownership
sudo cp pushgateway-1.4.2.linux-amd64/pushgateway /usr/local/bin/
sudo useradd -rs /bin/false pushgateway
sudo chown pushgateway:pushgateway /usr/local/bin/pushgateway
Step 2: Create a service file and add below mentioned code into it.
sudo vi /etc/systemd/system/pushgateway.service
[Unit]
Description=Prometheus Pushgateway
Wants=network-online.target
After=network-online.target
[Service]
User=pushgateway
Group=pushgateway
Type=simple
ExecStart=/usr/local/bin/pushgateway
[Install]
WantedBy=multi-user.target
Step 3: Enable the process.
sudo systemctl enable pushgateway
sudo systemctl start pushgateway
sudo systemctl status pushgateway
To verify and read the matrics :- http://localhost:9091/metrics
Step 4:Configure Pushgateway as a Scrape Target for Prometheus Server.
sudo vi /etc/prometheus/prometheus.yml
add below mentoioned job into configuration file
- job_name: 'Pushgateway'
honor_labels: true
static_configs:
- targets: ['54.160.237.50:9091']
sudo systemctl restart prometheus
Learn about What is Prometheus? and How does it work?
---
Thanks & Regards,
Kanchan Soni
(A girl who saw the dream with an open eye to compete with self capability in the area of IT and its Next-Gen Technology, with the ability to complete the task with perfection.)
Email: kanchansoni.cse@gmail.com
Comments
Post a Comment