forked from slok/sloth
-
Notifications
You must be signed in to change notification settings - Fork 1
/
home-wifi.yml
59 lines (58 loc) · 2.48 KB
/
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
53
54
55
56
57
58
59
# This example shows a real service level used in my home to have SLOs on my wifi signal.
# The metrics are extracted using unifi-poller (https://github.com/unifi-poller/unifi-poller)
# that gets the information from an Ubiquiti Wifi installation.
# https://community.ui.com/questions/satisfaction-percentage-in-client-properties-overview/8c940637-63d0-41de-a67b-8166cdd0ed32
#
# The service level has 2 SLOs based on `client_satisfaction_ratio`, this is a ratio calculated
# by ubiquiti that is based on wifi drop packages, wifi signal...
# We conside an SLI event the client satisfactions that currently exist, lets review the SLOs
#
# - `good-wifi-client-satisfaction`
# - This SLO warn us that we don't have a good wifi at home.
# - SLI error: We consider a bad client satisfaction (event) below 75% (0.75)
# - SLO objective (95%): We are not so restrictive and we allow that that 5 of every 100 clients be below 75%
#
# - `risk-wifi-client-satisfaction`
# - This SLO warn us that we something very bad is happenning with our home wifi.
# - SLI error: We consider a bad client satisfaction (event) below 50% (0.5)
# - SLO objective(99.9%): We are very restrictive and we allow that that 1 of every 1000 clients be below 50%
#
# `sloth generate -i ./examples/home-wifi.yml`
#
version: "prometheus/v1"
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:
error_query: sum_over_time((count(unifipoller_client_satisfaction_ratio < 0.75))[{{.window}}:]) OR on() vector(0)
total_query: sum_over_time((count(unifipoller_client_satisfaction_ratio))[{{.window}}:])
alerting:
name: GoodWifiClientSatisfaction
page_alert:
labels:
severity: home
ticket_alert:
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:
error_query: sum_over_time((count(unifipoller_client_satisfaction_ratio < 0.5))[{{.window}}:]) OR on() vector(0)
total_query: sum_over_time((count(unifipoller_client_satisfaction_ratio))[{{.window}}:])
alerting:
name: RiskWifiClientSatisfaction
page_alert:
labels:
severity: home
ticket_alert:
labels:
severity: warning