> ## Content Index
> Fetch the complete content index at: https://brianchristner.io/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to setup Prometheus Docker Monitoring
- URL: https://brianchristner.io/how-to-setup-prometheus-docker-monitoring/
- Published: 2015-08-19T11:26:59.000Z
- Updated: 2025-02-28T10:29:04.000Z
- Author: Brian Christner
- Tags: Docker, Monitoring

Continuing with the great response from the [Docker Monitoring ](https://www.brianchristner.io/how-to-setup-docker-monitoring/?ref=brianchristner.io)post. I am following up by investigating the setup of Prometheus. I first discovered Prometheus while making changes to the [cAdvisor](https://github.com/google/cadvisor?ref=brianchristner.io) documentation and noticed that cAdvisor now integrates with Prometheus.

So, what is [Prometheus](https://prometheus.io/?ref=brianchristner.io)? Prometheus was a solution created by SoundCloud (Yes, that SoundCloud). As current Docker monitoring solutions were not scratching their itch, they decided to roll out their solution to suit their needs.

Thankfully, SoundCloud decided to Open Source Prometheus in January 2015 as it is a great product. Look at the [SoundCloud blog back in January 2015](https://developers.soundcloud.com/blog/prometheus-monitoring-at-soundcloud?ref=brianchristner.io) for more details about the release.

> **UPDATE:** Tobi from SoundCloud clarified this paragraph. SoundCloud created Prometheus as a general monitoring solution that recently integrated Docker. Also, Prometheus has been open source since the beginning but was only announced at the beginning of this year. Thanks, Tobi!

OK, enough beating around the bush. How the heck can we deploy a [Prometheus Docker Monitoring](https://brianchristner.io/updated-docker-monitoring-prometheus-grafana/) stack? I spent a lot of time fine-tuning the docker-compose file so you can easily stand up a Prometheus stack with all the required components to quickly get up and running.

## Pre-requisites

Before installing the Prometheus stack, install [docker-compose](https://docs.docker.com/compose/install/?ref=brianchristner.io) on your Docker host machine.

## Installation & Configuration

Clone the [Prometheus Monitoring Project](https://github.com/vegasbrianc/prometheus?ref=brianchristner.io) locally to your Docker host.

If you want to change which targets should be monitored or make configuration changes, edit the [prometheus.yml ](https://github.com/vegasbrianc/prometheus/blob/master/prometheus/prometheus.yml?ref=brianchristner.io)file. The targets section. The targets section defines which components (data exporters) Prometheus should monitor. The names defined in this file are sourced from the service name in the docker-compose file. If you wish to change the names of the services, change the "container\_name" parameter in the docker-compose.yml file.

Once configurations are done, let's start them up. From the /prometheus project directory, run the following commands:

```
$ docker-compose up
$ docker-compose start

```

The Prometheus stack should now be running. To access the different components:

Prometheus: `http://<Host IP Address>:9090>` for example [http://192.168.10.1:9090](http://192.168.10.1:9090/?ref=brianchristner.io)

Prometheus Dashboard: `http://<Host IP Address>:3000` for example [http://192.168.10.1:3000](http://192.168.10.1:3000/?ref=brianchristner.io)

## Post Configuration

Now, we need to connect the Prometheus Dashboard to the Prometheus installation. Access the Prom Dash as mentioned above.

- Click the "Server" Menu at the top
- Click "New Server"
- Input the desired name, Prometheus server IP and port (`http://<Host IP Address>:9090>` ) and select Prometheus for server type.

![New Prometheus Server](https://storage.ghost.io/c/29/50/2950930d-60f2-422c-90aa-232fbd4873b6/content/images/2015/08/New_server.png)

## Configure Dashboards

Let's create our first Dashboard. Go to the Dashboard menu. First, create a new directory. Next, create a new Dashboard.

Here's a quick Dashboard I put together as an example.  

![Prometheus Dashboard](https://storage.ghost.io/c/29/50/2950930d-60f2-422c-90aa-232fbd4873b6/content/images/2015/08/Dashboard_example.png)

## Sample Dashboard Queries

The queries used in the example dashboard are located in the [Dashboards directory](https://github.com/vegasbrianc/prometheus/tree/master/dashboards?ref=brianchristner.io)

## ToDo

- Integrate Alerting with project
- Make a separate stack with just cAdvisor as the metric collection

### Follow me

If you liked this article, [Follow Me](https://twitter.com/idomyowntricks?ref=brianchristner.io) on Twitter to stay updated!

## Sign up for BrianChristner.io

I write Dockerfiles, Build Products, Share Ideas, and crash Mountain Bikes

Subscribe 

Email sent! Check your inbox to complete your signup. 

No spam. Unsubscribe anytime.