-
Notifications
You must be signed in to change notification settings - Fork 0
/
snippet.conf
31 lines (25 loc) · 757 Bytes
/
snippet.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
macro my_macro {
$routing_key = my-key
critNotification = critical_notification
}
template example_template {
subject = `{{.Alert.Vars.alert_name}}`
body = "Example body"
}
notification critical_notification {
post = https://my.webhook.net
body = {"state_message":{{.|json}},"alert_category":{{.Alert.Vars.alert_category}} }
contentType = application/json
}
alert my_alert {
$alert_category = my-category
$query = sum:a.b.c.d{}{foo=bar}
$anotherQuery = sum:a.b.c.d{}{foo=wildcard(b*)}
$metric_one = sum(q($redirects, "1h", "10m"))
$metric_two = sum(q($redirects_deviceatlas, "1h", "10m"))
$diff = abs($metric_one - $metric_two)
warn = $diff > 80
crit = $diff > 100
template = example_template
macro = my_macro
}