Skip to content

Commit d9183f5

Browse files
authored
[change] Changed default alert tolerances to reduce noise
1 parent 1b14359 commit d9183f5

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

docs/user/alerts.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ setting includes:
1818
- **Less than**: triggers when the value is below the threshold.
1919

2020
- **Threshold**: the metric value that triggers the alert.
21-
- **Tolerance**: the duration (in minutes) for which the threshold must be
22-
breached before an alert is triggered.
21+
- **Tolerance**: the duration (in minutes) the threshold must be
22+
continuously breached before triggering an alert. Helps reduce noise
23+
from flapping metrics.
2324

2425
OpenWISP Monitoring provides built-in alerts for the following metrics:
2526

@@ -42,7 +43,7 @@ enabled by default.
4243
========= =================
4344
Operator ``< (less than)``
4445
Threshold ``1``
45-
Tolerance ``0`` minutes
46+
Tolerance ``30`` minutes
4647
========= =================
4748

4849
.. note::
@@ -63,7 +64,7 @@ specified time. This alert is enabled by default.
6364
========= =================
6465
Operator ``< (less than)``
6566
Threshold ``1``
66-
Tolerance ``5`` minutes
67+
Tolerance ``10`` minutes
6768
========= =================
6869

6970
.. note::
@@ -103,7 +104,7 @@ default.
103104
========= ====================
104105
Operator ``> (greater than)``
105106
Threshold ``90`` (percent)
106-
Tolerance ``5`` minutes
107+
Tolerance ``30`` minutes
107108
========= ====================
108109

109110
Memory Usage
@@ -117,7 +118,7 @@ default.
117118
========= ====================
118119
Operator ``> (greater than)``
119120
Threshold ``95`` (percent)
120-
Tolerance ``5`` minutes
121+
Tolerance ``30`` minutes
121122
========= ====================
122123

123124
Disk Usage

openwisp_monitoring/device/tests/test_admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ def _assert_alertsettings_inline_in_response(response):
657657
)
658658
self.assertContains(
659659
response,
660-
'metric-content_type-object_id-0-alertsettings-0-custom_tolerance" value="0"',
660+
'metric-content_type-object_id-0-alertsettings-0-custom_tolerance" value="30"',
661661
)
662662

663663
with self.subTest(

openwisp_monitoring/monitoring/configuration.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def _get_access_tech():
118118
"query": chart_query["rtt"],
119119
},
120120
},
121-
"alert_settings": {"operator": "<", "threshold": 1, "tolerance": 0},
121+
"alert_settings": {"operator": "<", "threshold": 1, "tolerance": 30},
122122
"notification": {
123123
"problem": {
124124
"verbose_name": "Ping PROBLEM",
@@ -151,7 +151,7 @@ def _get_access_tech():
151151
"name": "Configuration Applied",
152152
"key": "config_applied",
153153
"field_name": "config_applied",
154-
"alert_settings": {"operator": "<", "threshold": 1, "tolerance": 5},
154+
"alert_settings": {"operator": "<", "threshold": 1, "tolerance": 10},
155155
"notification": {
156156
"problem": {
157157
"verbose_name": "Configuration Applied PROBLEM",
@@ -481,7 +481,7 @@ def _get_access_tech():
481481
"query": chart_query["memory"],
482482
}
483483
},
484-
"alert_settings": {"operator": ">", "threshold": 95, "tolerance": 5},
484+
"alert_settings": {"operator": ">", "threshold": 95, "tolerance": 30},
485485
"notification": {
486486
"problem": {
487487
"verbose_name": "Memory usage PROBLEM",
@@ -531,7 +531,7 @@ def _get_access_tech():
531531
"query": chart_query["cpu"],
532532
}
533533
},
534-
"alert_settings": {"operator": ">", "threshold": 90, "tolerance": 5},
534+
"alert_settings": {"operator": ">", "threshold": 90, "tolerance": 30},
535535
"notification": {
536536
"problem": {
537537
"verbose_name": "CPU usage PROBLEM",

openwisp_monitoring/monitoring/tests/test_admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_alert_settings_inline(self):
3030
self.assertEqual(r.status_code, 200)
3131
self.assertContains(r, '<option value="&lt;" selected>less than</option>')
3232
self.assertContains(r, 'name="alertsettings-0-custom_threshold" value="1"')
33-
self.assertContains(r, 'name="alertsettings-0-custom_tolerance" value="0"')
33+
self.assertContains(r, 'name="alertsettings-0-custom_tolerance" value="30"')
3434

3535
def test_admin_menu_groups(self):
3636
# Test menu group (openwisp-utils menu group) for Metric and Check models

0 commit comments

Comments
 (0)