...
We create a folder (eg "mkdir prometheus") in which we insert the docker-compose.yml
file
Code Block | |||||
---|---|---|---|---|---|
| |||||
| |||||
version: '3' |
Always inside the prometheus folder we create 2 other folders, called promconf and promdata, where we will insert, respectively, our configurations, present in the prometheus.yml
file, and storage. The latter allows you to configure Prometheus to monitor itself. The just mentioned configuration file is
Code Blockpanel | ||||||
---|---|---|---|---|---|---|
| ||||||
global: |
Prometheus collects metrics of monitored targets by scraping the HTTP endpoints of these targets. Since Prometheus himself exposes his internal metrics through the same mechanism, it is possible to scrape and monitor his health through the same mechanism.
Now let's launch the background service with the command
...
In general, if we wanted to launch Prometheus with a custom version, we can further modify the prometheus.yml
file. For example, it is possible to modify the global configuration of the Prometheus server, specify the location of additional .yaml files containing rules that we want to upload to the server or define which resources should be monitored. An extensive overview of the possible configurations is available here.