more documentation about squid charts
Costa Tsaousis (ktsaou) committed
May 30, 2017 at 22:54 UTC
dfe41466bdea5ac0487b340d9ef174915ce3a71d
2 files changed
+67
-15
python.d/web_log.chart.py
+8
-5
@@ -134,7 +134,8 @@ CHARTS_SQUID = {
134
['successful_requests', 'success', 'incremental', 1, 1],
135
['server_errors', 'error', 'incremental', 1, 1],
136
['redirects', 'redirect', 'incremental', 1, 1],
137
- ['bad_requests', 'bad', 'incremental', 1, 1]
137
+ ['bad_requests', 'bad', 'incremental', 1, 1],
138
+ ['other_requests', 'other', 'incremental', 1, 1]
139
]},
140
'squid_response_codes': {
141
'options': [None, 'Response Codes', 'responses/s', 'squid_responses',
@@ -762,7 +763,7 @@ class Squid(Mixin):
763
'0xx': 0, '1xx': 0, '2xx': 0, '3xx': 0, '4xx': 0, '5xx': 0,
764
'other': 0, 'unmatched': 0, 'unique_ipv4': 0, 'unique_ipv6': 0,
765
'unique_tot_ipv4': 0, 'unique_tot_ipv6': 0, 'successful_requests': 0,
765
- 'redirects': 0, 'bad_requests': 0, 'server_errors': 0
766
+ 'redirects': 0, 'bad_requests': 0, 'server_errors': 0, 'other_requests': 0
767
}
768
769
def check(self):
@@ -845,14 +846,16 @@ class Squid(Mixin):
846
:return:
847
"""
848
code_class = code[0]
848
- if code_class == '2' or code == '304' or code_class == '1':
849
+ if code_class == '2' or code == '304' or code_class == '1' or code == '000':
850
self.data['successful_requests'] += 1
851
elif code_class == '3':
852
self.data['redirects'] += 1
852
- elif code_class == '5':
853
+ elif code_class == '4':
854
+ self.data['bad_requests'] += 1
855
+ elif code_class == '5' or code_class == '6':
856
self.data['server_errors'] += 1
857
else:
855
- self.data['bad_requests'] += 1
858
+ self.data['other_requests'] += 1
859
860
def get_data_per_squid_code(self, code):
861
"""
web/dashboard_info.js
+59
-10
@@ -310,12 +310,12 @@ netdataDashboard.submenu = {
310
},
311
312
'web_log.squid_squid_transport': {
313
- title: 'squid_transport',
313
+ title: 'transport',
314
info: 'Analysis of the protocols used to receive the requests.'
315
},
316
317
'web_log.squid_squid_cache': {
318
- title: 'squid_cache',
318
+ title: 'cache',
319
info: 'Performance metrics for the performance of the squid cache.'
320
},
321
@@ -1060,10 +1060,10 @@ netdataDashboard.context = {
1060
1061
'web_log.squid_response_statuses': {
1062
info: 'Squid responses by type. ' +
1063
- '<code>success</code> includes <b>1xx</b>, <b>2xx</b> and <b>304</b>, ' +
1064
- '<code>error</code> includes <b>5xx</b>, ' +
1063
+ '<code>success</code> includes <b>1xx</b>, <b>2xx</b>, <b>000</b> <b>304</b>, ' +
1064
+ '<code>error</code> includes <b>5xx</b> and <b>6xx</b>, ' +
1065
'<code>redirect</code> includes <b>3xx</b> except <b>304</b>, ' +
1066
- '<code>bad</code> includes <b>0xx</b>, <b>4xx</b> and <b>6xx</b>, ' +
1066
+ '<code>bad</code> includes <b>4xx</b>, ' +
1067
'<code>other</code> are all the other responses.',
1068
mainheads: [
1069
function(os, id) {
@@ -1147,7 +1147,7 @@ netdataDashboard.context = {
1147
'<code>3xx</code> are redirects (although they include <b>304</b> which is used as "<b>not modified</b>"), ' +
1148
'<code>4xx</code> are bad requests, ' +
1149
'<code>5xx</code> are internal server errors. ' +
1150
- 'Squid also defines <code>0xx</code> for undefined, and ' +
1150
+ 'Squid also defines <code>000</code> mostly for UDP requests, and ' +
1151
'<code>6xx</code> for broken upstream servers sending wrong headers. ' +
1152
'Finally, <code>other</code> are non-standard responses, and ' +
1153
'<code>unmatched</code> counts the lines in the log file that are not matched by the plugin (<a href="https://github.com/firehol/netdata/issues/new?title=web_log%20reports%20unmatched%20lines&body=web_log%20plugin%20reports%20unmatched%20lines.%0A%0AThis%20is%20my%20log:%0A%0A%60%60%60txt%0A%0Aplease%20paste%20your%20web%20server%20log%20here%0A%0A%60%60%60" target="_blank">let us know</a> if you have any unmatched).'
@@ -1178,15 +1178,64 @@ netdataDashboard.context = {
1178
info: 'Number of responses for each response code individually.'
1179
},
1180
1181
- 'web_log.squid_transport_methods': {
1182
- info: 'Requests received per IP protocol.'
1183
- },
1184
-
1181
'web_log.squid_clients': {
1182
info: 'Unique client IPs accessing squid, within each data collection iteration. If data collection is <b>per second</b>, this chart shows <b>unique client IPs per second</b>.'
1183
},
1184
1185
'web_log.squid_clients_all': {
1186
info: 'Unique client IPs accessing squid since the last restart of netdata. This plugin keeps in memory all the unique IPs that have accessed the server. On very busy squid servers (several millions of unique IPs) you may want to disable this chart (check <a href="https://github.com/firehol/netdata/blob/master/conf.d/python.d/web_log.conf" target="_blank"><code>/etc/netdata/python.d/web_log.conf</code></a>).'
1187
+ },
1188
+
1189
+ 'web_log.squid_transport_methods': {
1190
+ info: 'Break down per delivery method: <code>TCP</code> are requests on the HTTP port (usually 3128), ' +
1191
+ '<code>UDP</code> are requests on the ICP port (usually 3130), or HTCP port (usually 4128). ' +
1192
+ 'If ICP logging was disabled using the log_icp_queries option, no ICP replies will be logged. ' +
1193
+ '<code>NONE</code> are used to state that squid delivered an unusual response or no response at all. ' +
1194
+ 'Seen with cachemgr requests and errors, usually when the transaction fails before being classified into one of the above outcomes. ' +
1195
+ 'Also seen with responses to <code>CONNECT</code> requests.'
1196
+ },
1197
+
1198
+ 'web_log.squid_code': {
1199
+ info: 'These are combined squid result status codes. A break down per component is given in the following charts. ' +
1200
+ 'Check the <a href="http://wiki.squid-cache.org/SquidFaq/SquidLogs">squid documentation about them</a>.'
1201
+ },
1202
+
1203
+ 'web_log.squid_handling_opts': {
1204
+ info: 'These tags are optional and describe why the particular handling was performed or where the request came from. ' +
1205
+ '<code>CLIENT</code> means that the client request placed limits affecting the response. Usually seen with client issued a <b>no-cache</b>, or analogous cache control command along with the request. Thus, the cache has to validate the object.' +
1206
+ '<code>IMS</code> states that the client sent a revalidation (conditional) request. ' +
1207
+ '<code>ASYNC</code>, is used when the request was generated internally by Squid. Usually this is background fetches for cache information exchanges, background revalidation from stale-while-revalidate cache controls, or ESI sub-objects being loaded. ' +
1208
+ '<code>SWAPFAIL</code> is assigned when the object was believed to be in the cache, but could not be accessed. A new copy was requested from the server. ' +
1209
+ '<code>REFRESH</code> when a revalidation (conditional) request was sent to the server. ' +
1210
+ '<code>SHARED</code> when this request was combined with an existing transaction by collapsed forwarding. NOTE: the existing request is not marked as SHARED. ' +
1211
+ '<code>REPLY</code> when particular handling was requested in the HTTP reply from server or peer. Usually seen on DENIED due to http_reply_access ACLs preventing delivery of servers response object to the client.'
1212
+ },
1213
+
1214
+ 'web_log.squid_object_types': {
1215
+ info: 'These tags are optional and describe what type of object was produced. ' +
1216
+ '<code>NEGATIVE</code> is only seen on HIT responses, indicating the response was a cached error response. e.g. <b>404 not found</b>. ' +
1217
+ '<code>STALE</code> means the object was cached and served stale. This is usually caused by stale-while-revalidate or stale-if-error cache controls. ' +
1218
+ '<code>OFFLINE</code> when the requested object was retrieved from the cache during offline_mode. The offline mode never validates any object. ' +
1219
+ '<code>INVALID</code> when an invalid request was received. An error response was delivered indicating what the problem was. ' +
1220
+ '<code>FAIL</code> is only seen on <code>REFRESH</code> to indicate the revalidation request failed. The response object may be the server provided network error or the stale object which was being revalidated depending on stale-if-error cache control. ' +
1221
+ '<code>MODIFIED</code> is only seen on <code>REFRESH</code> responses to indicate revalidation produced a new modified object. ' +
1222
+ '<code>UNMODIFIED</code> is only seen on <code>REFRESH</code> responses to indicate revalidation produced a <b>304</b> (Not Modified) status, which was relayed to the client. ' +
1223
+ '<code>REDIRECT</code> when squid generated an HTTP redirect response to this request.'
1224
+ },
1225
+
1226
+ 'web_log.squid_cache_events': {
1227
+ info: 'These tags are optional and describe whether the response was loaded from cache, network, or otherwise. ' +
1228
+ '<code>HIT</code> when the response object delivered was the local cache object. ' +
1229
+ '<code>MEM</code> when the response object came from memory cache, avoiding disk accesses. Only seen on HIT responses. ' +
1230
+ '<code>MISS</code> when the response object delivered was the network response object. ' +
1231
+ '<code>DENIED</code> when the request was denied by access controls. ' +
1232
+ '<code>NOFETCH</code> an ICP specific type, indicating service is alive, but not to be used for this request (sent during "-Y" startup, or during frequent failures, a cache in hit only mode will return either UDP_HIT or UDP_MISS_NOFETCH. Neighbours will thus only fetch hits). ' +
1233
+ '<code>TUNNEL</code> when a binary tunnel was established for this transaction.'
1234
+ },
1235
+
1236
+ 'web_log.squid_transport_errors': {
1237
+ info: 'These tags are optional and describe some error conditions which occured during response delivery (if any). ' +
1238
+ '<code>ABORTED</code> when the response was not completed due to the connection being aborted (usually by the client). ' +
1239
+ '<code>TIMEOUT</code>, when the response was not completed due to a connection timeout.'
1240
}
1241
};