How To Install prometheus-varnish-exporter on Ubuntu 18.04

In this tutorial we learn how to install prometheus-varnish-exporter on Ubuntu 18.04. prometheus-varnish-exporter is Prometheus exporter for Varnish

Introduction

In this tutorial we learn how to install prometheus-varnish-exporter on Ubuntu 18.04.

What is prometheus-varnish-exporter

prometheus-varnish-exporter is:

Prometheus exporter for Varnish metrics.

prometheus-varnish-exporter scrapes the varnishstat -j JSON output on each Prometheus collect and exposes all reported metrics. Metrics with multiple backends or Varnish defined identifiers (e.g. VBE..happy SMA..c_bytes LCK..creat) and other metrics with similar structure (e.g. MAIN.fetch_) are combined under a single metric name with distinguishable labels. Vanish naming conventions are preserved as much as possible to be familiar to Varnish users when building queries, while at the same time trying to following Prometheus conventions like lower casing and using _ separators.

There are three methods to install prometheus-varnish-exporter on Ubuntu 18.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-varnish-exporter 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-varnish-exporter using apt-get by running the following command:

sudo apt-get -y install prometheus-varnish-exporter

Install prometheus-varnish-exporter Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install prometheus-varnish-exporter using apt by running the following command:

sudo apt -y install prometheus-varnish-exporter

Install prometheus-varnish-exporter 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-varnish-exporter using aptitude by running the following command:

sudo aptitude -y install prometheus-varnish-exporter

How To Uninstall prometheus-varnish-exporter on Ubuntu 18.04

To uninstall only the prometheus-varnish-exporter package we can use the following command:

sudo apt-get remove prometheus-varnish-exporter

Uninstall prometheus-varnish-exporter And Its Dependencies

To uninstall prometheus-varnish-exporter and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove prometheus-varnish-exporter

Remove prometheus-varnish-exporter Configurations and Data

To remove prometheus-varnish-exporter configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge prometheus-varnish-exporter

Remove prometheus-varnish-exporter configuration, data, and all of its dependencies

We can use the following command to remove prometheus-varnish-exporter configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge prometheus-varnish-exporter

References

Summary

In this tutorial we learn how to install prometheus-varnish-exporter package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.