update
This commit is contained in:
parent
9549291be7
commit
874e255d7e
|
@ -309,7 +309,7 @@ Several changes are needed
|
|||
and the path to the `rule_files`
|
||||
|
||||
<details>
|
||||
<summary>`docker-compose.yml`</summary>
|
||||
<summary>docker-compose.yml</summary>
|
||||
```yml
|
||||
services:
|
||||
|
||||
|
@ -432,7 +432,7 @@ receivers:
|
|||
</details>
|
||||
|
||||
<details>
|
||||
<summary>`alert.rules`</summary>
|
||||
<summary>alert.rules</summary>
|
||||
```yml
|
||||
groups:
|
||||
- name: host
|
||||
|
@ -448,19 +448,43 @@ groups:
|
|||
</details>
|
||||
|
||||
<details>
|
||||
<summary>`prometheus.yml`</summary>
|
||||
aaa
|
||||
<summary>prometheus.yml</summary>
|
||||
```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'
|
||||
```
|
||||
</details>
|
||||
|
||||
|
||||
|
||||
test:<br>
|
||||
`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@<host-ip>:9090/-/reload`
|
||||
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
|
Loading…
Reference in New Issue