6. Configuration
tip
There is a lot of copy/paste in this section, but it is highly recommended that you try to understand each step. Please use our official discord for support.
Prometheus
Let’s edit the Prometheus config file and add all the modules to it:
sudo nano /etc/prometheus/prometheus.yml
Add the following code to the file and save ctrl+o
ctrl+x
:
global:
scrape_interval: 15s
evaluation_interval: 15s
rule_files:
- 'rules.yml'
alerting:
alertmanagers:
- static_configs:
- targets:
- localhost:9093
scrape_configs:
- job_name: "prometheus"
scrape_interval: 5s
static_configs:
- targets: ["localhost:9090"]
- job_name: "substrate_node"
scrape_interval: 5s
static_configs:
- targets: ["localhost:9615"]
- job_name: "node_exporter"
scrape_interval: 5s
static_configs:
- targets: ["localhost:9100"]
- job_name: "process-exporter"
scrape_interval: 5s
static_configs:
- targets: ["localhost:9256"]
scrape_interval
defines how often Prometheus scrapes targets, whileevaluation_interval
controls how often the software will evaluate the rules.rule_files
sets the location of Alert manager rules that we will add next.alerting
contains the alert manager target.scrape_configs
contain the services Prometheus will monitor.