@cryptotaxi247 / netdata-1 / commits / e5207d67c

new web_log alarms to account 1xx, 2xx and 304 as successful; fixes #1780, fixes #1781

Costa Tsaousis committed Feb 13, 2017 at 16:47 UTC e5207d67cbddaed531b6b49f270a9e2f9f4149bf
1 file changed +32 -40
conf.d/health.d/web_log.conf
+32 -40
@@ -25,7 +25,7 @@ families: *
25 # i.e. when there are at least 120 requests during the last minute
26
27 template: 1m_requests
28 - on: web_log.response_codes
28 + on: web_log.response_statuses
29 families: *
30 lookup: sum -1m unaligned
31 calc: ($this == 0)?(1):($this)
@@ -33,57 +33,49 @@ families: *
33 every: 10s
34 info: the sum of all HTTP requests over the last minute
35
36 -template: 1m_2xx
37 - on: web_log.response_codes
38 -families: *
39 - lookup: sum -1m unaligned of 2xx
40 - calc: ($this == 0)?(1):($this)
41 - units: requests
42 - every: 10s
43 - info: the sum of successful HTTP requests over the last minute
44 -
36 template: 1m_successful
46 - on: web_log.response_codes
37 + on: web_log.response_statuses
38 families: *
48 - calc: $1m_2xx * 100 / $1m_requests
39 + lookup: sum -1m unaligned of successful_requests
40 + calc: $this * 100 / $1m_requests
41 units: %
42 every: 10s
51 - warn: ($1m_requests > 120) ? ($this < (($status >= $WARNING ) ? ( 98 ) : ( 95 )) ) : ( 0 )
52 - crit: ($1m_requests > 120) ? ($this < (($status == $CRITICAL) ? ( 95 ) : ( 90 )) ) : ( 0 )
43 + warn: ($1m_requests > 120) ? ($this < (($status >= $WARNING ) ? ( 95 ) : ( 85 )) ) : ( 0 )
44 + crit: ($1m_requests > 120) ? ($this < (($status == $CRITICAL) ? ( 85 ) : ( 75 )) ) : ( 0 )
45 delay: down 15m multiplier 1.5 max 1h
54 - info: the ratio of successful HTTP responses (2xx) over the last minute
46 + info: the ratio of successful HTTP responses (1xx, 2xx, 304) over the last minute
47 to: webmaster
48
49 template: 1m_redirects
58 - on: web_log.detailed_response_codes
50 + on: web_log.response_statuses
51 families: *
60 - lookup: sum -1m unaligned of 301,303,307,308
52 + lookup: sum -1m unaligned of redirects
53 calc: $this * 100 / $1m_requests
54 units: %
55 every: 10s
64 - warn: ($1m_requests > 120) ? ($this > (($status >= $WARNING ) ? ( 1 ) : ( 2 )) ) : ( 0 )
65 - crit: ($1m_requests > 120) ? ($this > (($status == $CRITICAL) ? ( 2 ) : ( 5 )) ) : ( 0 )
56 + warn: ($1m_requests > 120) ? ($this > (($status >= $WARNING ) ? ( 1 ) : ( 20 )) ) : ( 0 )
57 + crit: ($1m_requests > 120) ? ($this > (($status == $CRITICAL) ? ( 20 ) : ( 30 )) ) : ( 0 )
58 delay: down 15m multiplier 1.5 max 1h
67 - info: the ratio of HTTP redirects (301, 303, 307, 308) over the last minute
59 + info: the ratio of HTTP redirects (3xx except 304) over the last minute
60 to: webmaster
61
62 template: 1m_bad_requests
71 - on: web_log.response_codes
63 + on: web_log.response_statuses
64 families: *
73 - lookup: sum -1m unaligned of 4xx
65 + lookup: sum -1m unaligned of bad_requests
66 calc: $this * 100 / $1m_requests
67 units: %
68 every: 10s
77 - warn: ($1m_requests > 120) ? ($this > (($status >= $WARNING) ? ( 1 ) : ( 5 )) ) : ( 0 )
78 - crit: ($1m_requests > 120) ? ($this > (($status == $CRITICAL) ? ( 5 ) : ( 10 )) ) : ( 0 )
69 + warn: ($1m_requests > 120) ? ($this > (($status >= $WARNING) ? ( 10 ) : ( 30 )) ) : ( 0 )
70 + crit: ($1m_requests > 120) ? ($this > (($status == $CRITICAL) ? ( 30 ) : ( 50 )) ) : ( 0 )
71 delay: down 15m multiplier 1.5 max 1h
72 info: the ratio of HTTP bad requests (4xx) over the last minute
73 to: webmaster
74
75 template: 1m_internal_errors
84 - on: web_log.response_codes
76 + on: web_log.response_statuses
77 families: *
86 - lookup: sum -1m unaligned of 5xx
78 + lookup: sum -1m unaligned of server_errors
79 calc: $this * 100 / $1m_requests
80 units: %
81 every: 10s
@@ -132,38 +124,38 @@ families: *
124 # the following alarms trigger only when there are enough data.
125 # we assume there are enough data when:
126 #
135 -# $5m_2xx_last > 120
127 +# $5m_successful_old > 120
128 #
129 # i.e. when there were at least 120 requests during the 5 minutes starting
130 # at -10m and ending at -5m
131
140 -template: 5m_2xx_last
141 - on: web_log.response_codes
132 +template: 5m_successful_old
133 + on: web_log.response_statuses
134 families: *
143 - lookup: average -5m at -5m unaligned of 2xx
144 - units: requests
135 + lookup: average -5m at -5m unaligned of successful_requests
136 + units: requests/s
137 every: 30s
146 - info: average successful HTTP requests over the last 5 minutes
138 + info: average rate of successful HTTP requests over the last 5 minutes
139
148 -template: 5m_2xx_now
149 - on: web_log.response_codes
140 +template: 5m_successful
141 + on: web_log.response_statuses
142 families: *
151 - lookup: average -5m unaligned of 2xx
152 - units: requests
143 + lookup: average -5m unaligned of successful_requests
144 + units: requests/s
145 every: 30s
146 info: average successful HTTP requests over the last 5 minutes
147
148 template: 5m_requests_ratio
149 on: web_log.response_codes
150 families: *
159 - calc: ($5m_2xx_last > 0)?($5m_2xx_now * 100 / $5m_2xx_last):(100)
151 + calc: ($5m_successful_old > 0)?($5m_successful * 100 / $5m_successful_old):(100)
152 units: %
153 every: 30s
162 - warn: ($5m_2xx_last > 120) ? ($this > 200 OR $this < 50) : (0)
163 - crit: ($5m_2xx_last > 120) ? ($this > 400 OR $this < 25) : (0)
154 + warn: ($5m_successful_old > 120) ? ($this > 200 OR $this < 50) : (0)
155 + crit: ($5m_successful_old > 120) ? ($this > 400 OR $this < 25) : (0)
156 delay: down 15m multiplier 1.5 max 1h
157 options: no-clear-notification
166 - info: the percentage of web requests over the last 5 minutes, \
158 + info: the percentage of successful web requests over the last 5 minutes, \
159 compared with the previous 5 minutes
160 to: webmaster
161