]> arthur.barton.de Git - netdata.git/blob - conf.d/health.d/web_log.conf
Merge pull request #1760 from ktsaou/master
[netdata.git] / conf.d / health.d / web_log.conf
1
2 # make sure we can collect web log data
3
4 template: last_collected_secs
5       on: web_log.response_codes
6 families: *
7     calc: $now - $last_collected_t
8    units: seconds ago
9    every: 10s
10     warn: $this > (($status >= $WARNING)  ? ($update_every) : ( 5 * $update_every))
11     crit: $this > (($status == $CRITICAL) ? ($update_every) : (60 * $update_every))
12    delay: down 5m multiplier 1.5 max 1h
13     info: number of seconds since the last successful data collection
14       to: webmaster
15
16
17 # -----------------------------------------------------------------------------
18 # high level response code alarms
19
20 # the following alarms trigger only when there are enough data.
21 # we assume there are enough data when:
22 #
23 #  $1m_requests > 120
24 #
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
29 families: *
30   lookup: sum -1m unaligned
31     calc: ($this == 0)?(1):($this)
32    units: requests
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
45 template: 1m_successful
46       on: web_log.response_codes
47 families: *
48     calc: $1m_2xx * 100 / $1m_requests
49    units: %
50    every: 10s
51     warn: ($1m_requests > 120) ? ($this < (($status >= $WARNING ) ? ( 98 ) : ( 95 )) ) : ( 0 )
52     crit: ($1m_requests > 120) ? ($this < (($status == $CRITICAL) ? ( 95 ) : ( 90 )) ) : ( 0 )
53    delay: down 15m multiplier 1.5 max 1h
54     info: the ratio of successful HTTP responses (2xx) over the last minute
55       to: webmaster
56
57 template: 1m_redirects
58       on: web_log.detailed_response_codes
59 families: *
60   lookup: sum -1m unaligned of 301,303,307,308
61     calc: $this * 100 / $1m_requests
62    units: %
63    every: 10s
64     warn: ($1m_requests > 120) ? ($this > (($status >= $WARNING ) ? ( 1 ) : ( 2 )) ) : ( 0 )
65     crit: ($1m_requests > 120) ? ($this > (($status == $CRITICAL) ? ( 2 ) : ( 5 )) ) : ( 0 )
66    delay: down 15m multiplier 1.5 max 1h
67     info: the ratio of HTTP redirects (301, 303, 307, 308) over the last minute
68       to: webmaster
69
70 template: 1m_bad_requests
71       on: web_log.response_codes
72 families: *
73   lookup: sum -1m unaligned of 4xx
74     calc: $this * 100 / $1m_requests
75    units: %
76    every: 10s
77     warn: ($1m_requests > 120) ? ($this > (($status >= $WARNING)  ? ( 1 ) : (  5 )) ) : ( 0 )
78     crit: ($1m_requests > 120) ? ($this > (($status == $CRITICAL) ? ( 5 ) : ( 10 )) ) : ( 0 )
79    delay: down 15m multiplier 1.5 max 1h
80     info: the ratio of HTTP bad requests (4xx) over the last minute
81       to: webmaster
82
83 template: 1m_internal_errors
84       on: web_log.response_codes
85 families: *
86   lookup: sum -1m unaligned of 5xx
87     calc: $this * 100 / $1m_requests
88    units: %
89    every: 10s
90     warn: ($1m_requests > 120) ? ($this > (($status >= $WARNING)  ? ( 1 ) : ( 2 )) ) : ( 0 )
91     crit: ($1m_requests > 120) ? ($this > (($status == $CRITICAL) ? ( 2 ) : ( 5 )) ) : ( 0 )
92    delay: down 15m multiplier 1.5 max 1h
93     info: the ratio of HTTP internal server errors (5xx), over the last minute
94       to: webmaster
95
96
97 # -----------------------------------------------------------------------------
98 # web slow
99
100 # the following alarms trigger only when there are enough data.
101 # we assume there are enough data when:
102 #
103 #  $1m_requests > 120
104 #
105 # i.e. when there are at least 120 requests during the last minute
106
107 template: 10m_response_time
108       on: web_log.response_time
109 families: *
110   lookup: average -10m unaligned of avg
111    units: ms
112    every: 30s
113     info: the average time to respond to HTTP requests, over the last 10 minutes
114
115 template: web_slow
116       on: web_log.response_time
117 families: *
118   lookup: average -1m unaligned of avg
119    units: ms
120    every: 10s
121    green: 500
122      red: 1000
123     warn: ($1m_requests > 120) ? ($this > $green && $this > ($10m_response_time * 2) ) : ( 0 )
124     crit: ($1m_requests > 120) ? ($this > $red   && $this > ($10m_response_time * 4) ) : ( 0 )
125    delay: down 15m multiplier 1.5 max 1h
126     info: the average time to respond to HTTP requests, over the last 1 minute
127       to: webmaster
128
129 # -----------------------------------------------------------------------------
130 # web too many or too few requests
131
132 # the following alarms trigger only when there are enough data.
133 # we assume there are enough data when:
134 #
135 #  $5m_2xx_last > 120
136 #
137 # i.e. when there were at least 120 requests during the 5 minutes starting
138 #      at -10m and ending at -5m
139
140 template: 5m_2xx_last
141       on: web_log.response_codes
142 families: *
143   lookup: average -5m at -5m unaligned of 2xx
144    units: requests
145    every: 30s
146     info: average successful HTTP requests over the last 5 minutes
147
148 template: 5m_2xx_now
149       on: web_log.response_codes
150 families: *
151   lookup: average -5m unaligned of 2xx
152    units: requests
153    every: 30s
154     info: average successful HTTP requests over the last 5 minutes
155
156 template: 5m_requests_ratio
157       on: web_log.response_codes
158 families: *
159     calc: ($5m_2xx_last > 0)?($5m_2xx_now * 100 / $5m_2xx_last):(100)
160    units: %
161    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)
164    delay: down 15m multiplier 1.5 max 1h
165 options: no-clear-notification
166     info: the percentage of web requests over the last 5 minutes, \
167           compared with the previous 5 minutes
168       to: webmaster
169