A word from our sponsors

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sw:prometheus:intro [2022/01/11 10:55] Frank Fegertsw:prometheus:intro [2022/01/11 11:20] (current) Frank Fegert
Line 119: Line 119:
  
 ====== Configuration ====== ====== Configuration ======
 +
 +===== Initial =====
  
 Configure the //Prometheus// data directory: Configure the //Prometheus// data directory:
Line 131: Line 133:
 [...] [...]
 ARGS="--storage.tsdb.path='/srv/prometheus/metrics2/'" ARGS="--storage.tsdb.path='/srv/prometheus/metrics2/'"
 +[...]
 +</file>
 +
 +===== Adding Prometheus to Grafana =====
 +
 +See [[sw:grafana:intro#adding_prometheus_to_grafana|Adding Prometheus to Grafana]]
 +
 +===== Scraping metrics with Prometheus =====
 +
 +Configure //Prometheus// to //scrape// metrics from various sources:
 +
 +==== Loki ====
 +
 +<cli>
 +root@host:~$ vi /etc/prometheus/prometheus.yml
 +</cli>
 +
 +File contents:
 +
 +<file config /etc/prometheus/prometheus.yml>
 +[...]
 +scrape_configs:
 +  [...]
 +  - job_name: loki
 +    static_configs:
 +      - targets: ['localhost:3100']
 +  [...]
 +[...]
 +</file>
 +
 +
 +==== Promtail ====
 +
 +<cli>
 +root@host:~$ vi /etc/prometheus/prometheus.yml
 +</cli>
 +
 +File contents:
 +
 +<file config /etc/prometheus/prometheus.yml>
 +[...]
 +scrape_configs:
 +  [...]
 +  - job_name: promtail
 +    static_configs:
 +      - targets: ['localhost:9080']
 +  [...]
 [...] [...]
 </file> </file>