Comparison

mod_pubsub_alertmanager/README.md @ 4623:622c6308d7af

mod_pubsub_alertmanager: Minimal example of Prometheus and Alertmanager config
author Kim Alvefur <zash@zash.se>
date Fri, 16 Jul 2021 17:34:24 +0200
parent 4622:61ce3394fe8b
child 4624:eba7e68120d8
comparison
equal deleted inserted replaced
4622:61ce3394fe8b 4623:622c6308d7af
17 Because the request IP address is used to publish, the `publisher` 17 Because the request IP address is used to publish, the `publisher`
18 affiliation should be given to the IP address Alertmanager sends 18 affiliation should be given to the IP address Alertmanager sends
19 webhooks from. 19 webhooks from.
20 20
21 # Configuration 21 # Configuration
22
23 ## Prometheus
24
25 A Prometheus `rule_files` might contain something along these lines:
26
27 ``` yaml
28 groups:
29 - name: Stuff
30 rules:
31 - alert: Down
32 expr: up == 0
33 for: 5m
34 annotations:
35 title: 'Stuff is down!'
36 labels:
37 severity: 'critical'
38 ```
39
40 ## Alertmanager
41 On the Alertmanager site the webhook configuration may look something
42 like this:
43
44 ``` yaml
45 receivers:
46 - name: pubsub
47 webhook_configs:
48 - url: http://pubsub.localhost:5280/pubsub_alertmanager
49 ```
50
51 And then finally some Alertmanager routes would point at that receiver:
52
53 ``` yaml
54 route:
55 receiver: pubsub
56 ```
57
58 ## Prosody
22 59
23 On the Prosody side, apart from creating and configuring the node(s) 60 On the Prosody side, apart from creating and configuring the node(s)
24 that will be used, configure your pubsub service like this: 61 that will be used, configure your pubsub service like this:
25 62
26 ``` lua 63 ``` lua
40 ]] 77 ]]
41 78
42 alertmanager_node_template = "alerts/{alert.labels.severity}" 79 alertmanager_node_template = "alerts/{alert.labels.severity}"
43 ``` 80 ```
44 81
82 ## All Options
83
45 Available configuration options: 84 Available configuration options:
46 85
47 `alertmanager_body_template` 86 `alertmanager_body_template`
48 : Template for the textual representation of alerts. 87 : Template for the textual representation of alerts.
49 88