Pages

Thursday, June 1, 2017

Kicking the tires of Prometheus using Docker on Fedora

Straight from the Prometheus documentation: "Prometheus is an open-source systems monitoring and alerting toolkit originally built at SoundCloud."

I haven't had a chance to even take a look at using Prometheus. Here I'll go over the steps I had to follow to get a working local Prometheus install monitoring my local Docker daemon so I could see metrics through the Prometheus dashboard.

First things first, here are the versions of what I am using (eh, until we find out what the problem is (listed below)):

Fedora 25

Docker

docker-1.12.6-6.gitae7d637.fc25.x86_64

docker-common-1.12.6-6.gitae7d637.fc25.x86_64

docker-latest-1.12.6-2.git51ef5a8.fc25.x86_64

Prometheus

prom/prometheus b0195cb1a666

So, there were a couple of places I went for documentation to get started:

So, following those docs, I tried to use the default Fedora Docker configuration. That did not work. The Docker documentation was off, at least for the version of Docker I am using. By default, in Fedora, you get a Docker package that is a bit out of date. Here are the steps I took and what I had to do as a workaround.

The next thing to do is enable the Docker daemon to expose and endpoint that Prometheus can monitor. This is where the Docker docs are off a bit. They suggest that you create a /etc/docker/daemon.json with the following configuration.

{
"metrics-addr" : "127.0.0.1:9323",
"experimental" : true
}

The issue with that is, Docker doesn't respect that configuration. So, instead, I chose to use the latest version of Docker in Fedora. To do this, I went to the Docker website for instructions. Following those got me to these versions:

Now that I had those, I could go back to the previous documentation from Docker to get started with Prometheus. That link is here: https://docs.docker.com/engine/admin/prometheus/and for the most part it worked. The issue was, I could start the container, but when I tried to hit the Prometheus target of http://localhost:9090/targets, I received the following error: