Downloading Prometheus

Let's download Prometheus to our Linux machine.

NOTE: If you don't have a Linux machine, you can also run these steps in a cloud-based environment using the free tier of GitHub Codespaces, by opening an empty starter workspace:

Open in GitHub Codespaces

You can open a terminal in the Codespaces environment using Ctrl+Shift+` (or Cmd+Shift+` on macOS) and selecting the option "Continue Working in GitHub Codespaces" when prompted. When asked to select a virtual machine size, the smallest possible option should be sufficient for the purposes of this training.

If you are using Codespaces to follow along, please note that any servers started in the Codespaces environment will not be externally accessible on their usual TCP ports (like 9090 for the Prometheus server). Instead, Codespaces will automatically detect when a server is started and will open a dialog providing a custom URL like https://<workspace>-9090.app.github.dev/ to access it (note the original port 9090 being encoded in the hostname instead).

Create a directory for this training files:

mkdir prometheus-training

Change to it:

cd prometheus-training

Download Prometheus 3.2.0 for Linux (see the download page for other versions and architectures):

wget https://github.com/prometheus/prometheus/releases/download/v3.2.0/prometheus-3.2.0.linux-amd64.tar.gz

Extract the tarball:

tar xvfz prometheus-3.2.0.linux-amd64.tar.gz

Change into the extracted directory:

cd prometheus-3.2.0.linux-amd64