]> arthur.barton.de Git - netdata.git/blob - conf.d/health.d/web_log.conf
Merge pull request #1758 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 # high level response code alarms
18
19 template: 1m_requests
20       on: web_log.response_codes
21 families: *
22   lookup: sum -1m unaligned
23     calc: ($this == 0)?(1):($this)
24    units: requests
25    every: 10s
26     info: the sum of all HTTP requests over the last minute
27
28 template: 1m_2xx
29       on: web_log.response_codes
30 families: *
31   lookup: sum -1m unaligned of 2xx
32     calc: ($this == 0)?(1):($this)
33    units: requests
34    every: 10s
35     info: the sum of successful HTTP requests over the last minute
36
37 template: 1m_successful
38       on: web_log.response_codes
39 families: *
40     calc: $1m_2xx * 100 / $1m_requests
41    units: %
42    every: 10s
43     warn: ($1m_requests > 30) ? ($this < (($status >= $WARNING ) ? ( 98 ) : ( 95 )) ) : ( 0 )
44     crit: ($1m_requests > 30) ? ($this < (($status == $CRITICAL) ? ( 95 ) : ( 90 )) ) : ( 0 )
45    delay: down 15m multiplier 1.5 max 1h
46     info: the ratio of HTTP redirects (3xx) vs the successful requests, \
47           over the last minute
48       to: webmaster
49
50 template: 1m_redirects
51       on: web_log.detailed_response_codes
52 families: *
53   lookup: sum -1m unaligned of 301,303,307,308
54     calc: $this * 100 / ( $1m_2xx + $this )
55    units: %
56    every: 10s
57     warn: ($1m_requests > 30) ? ($this > (($status >= $WARNING ) ? ( 1 ) : ( 2 )) ) : ( 0 )
58     crit: ($1m_requests > 30) ? ($this > (($status == $CRITICAL) ? ( 2 ) : ( 5 )) ) : ( 0 )
59    delay: down 15m multiplier 1.5 max 1h
60     info: the ratio of HTTP redirects (301, 303, 307, 308) vs the successful requests, \
61           over the last minute
62       to: webmaster
63
64 template: 1m_bad_requests
65       on: web_log.response_codes
66 families: *
67   lookup: sum -1m unaligned of 4xx
68     calc: $this * 100 / ( $1m_2xx + $this )
69    units: %
70    every: 10s
71     warn: ($1m_requests > 30) ? ($this > (($status >= $WARNING)  ? ( 1 ) : (  5 )) ) : ( 0 )
72     crit: ($1m_requests > 30) ? ($this > (($status == $CRITICAL) ? ( 5 ) : ( 10 )) ) : ( 0 )
73    delay: down 15m multiplier 1.5 max 1h
74     info: the ratio of HTTP bad requests (4xx) vs the successful requests, \
75           over the last minute
76       to: webmaster
77
78 template: 1m_internal_errors
79       on: web_log.response_codes
80 families: *
81   lookup: sum -1m unaligned of 5xx
82     calc: $this * 100 / ( $1m_2xx + $this )
83    units: %
84    every: 10s
85     warn: ($1m_requests > 30) ? ($this > (($status >= $WARNING)  ? ( 1 ) : ( 2 )) ) : ( 0 )
86     crit: ($1m_requests > 30) ? ($this > (($status == $CRITICAL) ? ( 2 ) : ( 5 )) ) : ( 0 )
87    delay: down 15m multiplier 1.5 max 1h
88     info: the ratio of HTTP internal server errors (5xx) vs the successful \
89           requests, over the last minute
90       to: webmaster
91
92 # -----------------------------------------------------------------------------
93 # web slow
94
95 template: 10m_response_time
96       on: web_log.response_time
97 families: *
98   lookup: average -10m unaligned of avg
99    units: ms
100    every: 30s
101     info: the average time to respond to HTTP requests, over the last 10 minutes
102
103 template: web_slow
104       on: web_log.response_time
105 families: *
106   lookup: average -1m unaligned of avg
107    units: ms
108    every: 10s
109    green: 500
110      red: 1000
111     warn: ($1m_requests > 30) ? ($this > $green && $this > ($10m_response_time * 2) ) : ( 0 )
112     crit: ($1m_requests > 30) ? ($this > $red   && $this > ($10m_response_time * 4) ) : ( 0 )
113    delay: down 15m multiplier 1.5 max 1h
114     info: the average time to respond to HTTP requests, over the last 1 minute
115       to: webmaster
116
117 # -----------------------------------------------------------------------------
118 # web too many or too few requests
119
120 template: 5m_2xx_last
121       on: web_log.response_codes
122 families: *
123   lookup: average -5m at -5m unaligned of 2xx
124    units: requests
125    every: 30s
126     info: average successful HTTP requests over the last 5 minutes
127
128 template: 5m_2xx_now
129       on: web_log.response_codes
130 families: *
131   lookup: average -5m unaligned of 2xx
132    units: requests
133    every: 30s
134     info: average successful HTTP requests over the last 5 minutes
135
136 template: 5m_requests_ratio
137       on: web_log.response_codes
138 families: *
139     calc: ($5m_2xx_last > 0)?($5m_2xx_now * 100 / $5m_2xx_last):(100)
140    units: %
141    every: 30s
142     warn: ($1m_requests > 30) ? (($5m_2xx_last > 30) ? ($this > 200 OR $this < 50) : (0) ) : ( 0 )
143     crit: ($1m_requests > 30) ? (($5m_2xx_last > 30) ? ($this > 400 OR $this < 25) : (0) ) : ( 0 )
144    delay: down 15m multiplier 1.5 max 1h
145 options: no-clear-notification
146     info: the percentage of web requests over the last 5 minutes, \
147           compared with the previous 15 minutes
148       to: webmaster
149