forked from slok/sloth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
k8s-home-wifi.yml
52 lines (51 loc) · 1.69 KB
/
k8s-home-wifi.yml
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# This example shows the same example as home-wifi.yml but using Sloth Kubernetes CRD.
# It will generate the Prometheus rules in a Kubernetes prometheus-operator PrometheusRules CRD.
#
# `sloth generate -i ./examples/k8s-home-wifi.yml`
#
apiVersion: sloth.slok.dev/v1
kind: PrometheusServiceLevel
metadata:
name: sloth-slo-home-wifi
namespace: monitoring
labels:
prometheus: prometheus
role: alert-rules
app: sloth
spec:
service: "home-wifi"
labels:
cluster: "valhalla"
component: "ubiquiti"
context: "home"
slos:
- name: "good-wifi-client-satisfaction"
objective: 95
description: "Will warn us that we don't have a good wifi at home."
sli:
events:
errorQuery: sum_over_time((count(unifipoller_client_satisfaction_ratio < 0.75))[{{.window}}:]) OR on() vector(0)
totalQuery: sum_over_time((count(unifipoller_client_satisfaction_ratio))[{{.window}}:])
alerting:
name: GoodWifiClientSatisfaction
pageAlert:
labels:
severity: home
ticketAlert:
labels:
severity: warning
- name: "risk-wifi-client-satisfaction"
objective: 99.9
description: "Will warn us that we something very bad is happenning with our home wifi."
sli:
events:
errorQuery: sum_over_time((count(unifipoller_client_satisfaction_ratio < 0.5))[{{.window}}:]) OR on() vector(0)
totalQuery: sum_over_time((count(unifipoller_client_satisfaction_ratio))[{{.window}}:])
alerting:
name: RiskWifiClientSatisfaction
pageAlert:
labels:
severity: home
ticketAlert:
labels:
severity: warning