From 874e255d7e0ee19c6ffdc35b14f596d4f6807b5a Mon Sep 17 00:00:00 2001 From: DoTheEvo Date: Sun, 5 Feb 2023 21:48:10 +0100 Subject: [PATCH] update --- prometheus_grafana/readme.md | 38 +++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/prometheus_grafana/readme.md b/prometheus_grafana/readme.md index a5ffcee..2fec2fa 100644 --- a/prometheus_grafana/readme.md +++ b/prometheus_grafana/readme.md @@ -309,7 +309,7 @@ Several changes are needed and the path to the `rule_files`
-`docker-compose.yml` +docker-compose.yml ```yml services: @@ -432,7 +432,7 @@ receivers:
-`alert.rules` +alert.rules ```yml groups: - name: host @@ -448,19 +448,43 @@ groups:
-`prometheus.yml` -aaa +prometheus.yml +```yml +global: + scrape_interval: 15s + evaluation_interval: 15s + +scrape_configs: + - job_name: 'nodeexporter' + static_configs: + - targets: ['nodeexporter:9100'] + + - job_name: 'cadvisor' + static_configs: + - targets: ['cadvisor:8080'] + + - job_name: 'prometheus' + static_configs: + - targets: ['localhost:9090'] + +alerting: + alertmanagers: + - scheme: http + static_configs: + - targets: + - 'alertmanager:9093' + +rule_files: + - '/etc/prometheus/rules/alert.rules' +```
- - test:
`curl -H 'Content-Type: application/json' -d '[{"labels":{"alertname":"blabla"}}]' https://alert.example.com/api/v1/alerts` reload rules `curl -X POST http://admin:admin@:9090/-/reload` - ---