How To Install prometheus-pushgateway on Ubuntu 20.04
Introduction
In this tutorial we learn how to install prometheus-pushgateway
on Ubuntu 20.04.
What is prometheus-pushgateway
prometheus-pushgateway is:
The Prometheus Pushgateway exists to allow ephemeral and batch jobs to expose their metrics to Prometheus. Since these kinds of jobs may not exist long enough to be scraped, they can instead push their metrics to a Pushgateway. The Pushgateway then exposes these metrics to Prometheus.
The Pushgateway is explicitly not an aggregator, but rather a metrics cache. It does not have a statsd-like semantics. The metrics pushed are exactly the same as you would present for scraping in a permanently running program.
For machine-level metrics, the textfile collector of prometheus-node-exporter is usually more appropriate. The Pushgateway is best used for service-level metrics.
There are three methods to install prometheus-pushgateway
on Ubuntu 20.04. We can use apt-get
, apt
and aptitude
. In the following sections we will describe each method. You can choose one of them.
Install prometheus-pushgateway Using apt-get
Update apt database with apt-get
using the following command.
sudo apt-get update
After updating apt database, We can install prometheus-pushgateway
using apt-get
by running the following command:
sudo apt-get -y install prometheus-pushgateway
Install prometheus-pushgateway Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install prometheus-pushgateway
using apt
by running the following command:
sudo apt -y install prometheus-pushgateway
Install prometheus-pushgateway Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude
using the following command.
sudo aptitude update
After updating apt database, We can install prometheus-pushgateway
using aptitude
by running the following command:
sudo aptitude -y install prometheus-pushgateway
How To Uninstall prometheus-pushgateway on Ubuntu 20.04
To uninstall only the prometheus-pushgateway
package we can use the following command:
sudo apt-get remove prometheus-pushgateway
Uninstall prometheus-pushgateway And Its Dependencies
To uninstall prometheus-pushgateway
and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:
sudo apt-get -y autoremove prometheus-pushgateway
Remove prometheus-pushgateway Configurations and Data
To remove prometheus-pushgateway
configuration and data from Ubuntu 20.04 we can use the following command:
sudo apt-get -y purge prometheus-pushgateway
Remove prometheus-pushgateway configuration, data, and all of its dependencies
We can use the following command to remove prometheus-pushgateway
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge prometheus-pushgateway
References
Summary
In this tutorial we learn how to install prometheus-pushgateway
package on Ubuntu 20.04 using different package management tools: apt
, apt-get
and aptitude
.