]> arthur.barton.de Git - netdata.git/blob - conf.d/health.d/web_log.conf
ab-debian 0.20170327.01-0ab1, upstream v1.6.0-42-gaa6b96fc
[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_statuses
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_successful
37       on: web_log.response_statuses
38 families: *
39   lookup: sum -1m unaligned of successful_requests
40     calc: $this * 100 / $1m_requests
41    units: %
42    every: 10s
43     warn: ($1m_requests > 120) ? ($this < (($status >= $WARNING ) ? ( 95 ) : ( 85 )) ) : ( 0 )
44     crit: ($1m_requests > 120) ? ($this < (($status == $CRITICAL) ? ( 85 ) : ( 75 )) ) : ( 0 )
45    delay: up 2m down 15m multiplier 1.5 max 1h
46     info: the ratio of successful HTTP responses (1xx, 2xx, 304) over the last minute
47       to: webmaster
48
49 template: 1m_redirects
50       on: web_log.response_statuses
51 families: *
52   lookup: sum -1m unaligned of redirects
53     calc: $this * 100 / $1m_requests
54    units: %
55    every: 10s
56     warn: ($1m_requests > 120) ? ($this > (($status >= $WARNING ) ? (  1 ) : ( 20 )) ) : ( 0 )
57     crit: ($1m_requests > 120) ? ($this > (($status == $CRITICAL) ? ( 20 ) : ( 30 )) ) : ( 0 )
58    delay: up 2m down 15m multiplier 1.5 max 1h
59     info: the ratio of HTTP redirects (3xx except 304) over the last minute
60       to: webmaster
61
62 template: 1m_bad_requests
63       on: web_log.response_statuses
64 families: *
65   lookup: sum -1m unaligned of bad_requests
66     calc: $this * 100 / $1m_requests
67    units: %
68    every: 10s
69     warn: ($1m_requests > 120) ? ($this > (($status >= $WARNING)  ? ( 10 ) : ( 30 )) ) : ( 0 )
70     crit: ($1m_requests > 120) ? ($this > (($status == $CRITICAL) ? ( 30 ) : ( 50 )) ) : ( 0 )
71    delay: up 2m 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
76       on: web_log.response_statuses
77 families: *
78   lookup: sum -1m unaligned of server_errors
79     calc: $this * 100 / $1m_requests
80    units: %
81    every: 10s
82     warn: ($1m_requests > 120) ? ($this > (($status >= $WARNING)  ? ( 1 ) : ( 2 )) ) : ( 0 )
83     crit: ($1m_requests > 120) ? ($this > (($status == $CRITICAL) ? ( 2 ) : ( 5 )) ) : ( 0 )
84    delay: up 2m down 15m multiplier 1.5 max 1h
85     info: the ratio of HTTP internal server errors (5xx), over the last minute
86       to: webmaster
87
88
89 # -----------------------------------------------------------------------------
90 # web slow
91
92 # the following alarms trigger only when there are enough data.
93 # we assume there are enough data when:
94 #
95 #  $1m_requests > 120
96 #
97 # i.e. when there are at least 120 requests during the last minute
98
99 template: 10m_response_time
100       on: web_log.response_time
101 families: *
102   lookup: average -10m unaligned of avg
103    units: ms
104    every: 30s
105     info: the average time to respond to HTTP requests, over the last 10 minutes
106
107 template: web_slow
108       on: web_log.response_time
109 families: *
110   lookup: average -1m unaligned of avg
111    units: ms
112    every: 10s
113    green: 500
114      red: 1000
115     warn: ($1m_requests > 120) ? ($this > $green && $this > ($10m_response_time * 2) ) : ( 0 )
116     crit: ($1m_requests > 120) ? ($this > $red   && $this > ($10m_response_time * 4) ) : ( 0 )
117    delay: down 15m multiplier 1.5 max 1h
118     info: the average time to respond to HTTP requests, over the last 1 minute
119       to: webmaster
120
121 # -----------------------------------------------------------------------------
122 # web too many or too few requests
123
124 # the following alarms trigger only when there are enough data.
125 # we assume there are enough data when:
126 #
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
132 template: 5m_successful_old
133       on: web_log.response_statuses
134 families: *
135   lookup: average -5m at -5m unaligned of successful_requests
136    units: requests/s
137    every: 30s
138     info: average rate of successful HTTP requests over the last 5 minutes
139
140 template: 5m_successful
141       on: web_log.response_statuses
142 families: *
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: *
151     calc: ($5m_successful_old > 0)?($5m_successful * 100 / $5m_successful_old):(100)
152    units: %
153    every: 30s
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
158     info: the percentage of successful web requests over the last 5 minutes, \
159           compared with the previous 5 minutes
160       to: webmaster
161