Prometheus: Installation

Hatice Sinem Başkal
2 min readFeb 3, 2022

The operating system and the developed applications use various resources such as processor, hard disk, ram, network in order to fulfill the expected function. Monitoring applications control the resources at regular intervals and ensure that the resources necessary for theoperation of the systems are followed. Prometheus is one of the tools that do this.

Prometheus uses tools called exporters to monitor resources. Since I used node exporter while developing the system, I will talk about node exporter in the rest of the article.

The exporter converts the data of the source to be monitored into a format that the Prometheus system can understand and presents it over the HTTP protocol. It saves the data to the Time Series-Time Series database by making HTTP requests at specified intervals to the exporter addresses added to the Prometheus settings. The recorded monitoring data is followed through tools

An example of architecture

  • Node Exporter(Collect logs from system)
  • Prometheus server (Stores metrics as time series data)
  • Alertmanager ( Sends alerts )
  • Grafana(Monitor System via Dashboard)

Installation Over Terminal

The installation processes are quite similar to the Grafana Loki installation.

  1. Create Docker Compose directory

mkdir ~/docker-compose

2. Create the docker config file that includes prometheus, node exporter, grafana and alertmanager here

touch docker-compose.yml

3. Create a prometheus directory to work in

mkdir prometheus

4. Create a service configuration file in prometheus folder

touch prometheus.yml

5. We are now all set to run our containers. To start the containers, run the command

docker-compose up

6. Now, we can open our prefered browser and it starts working by default.

--

--