You are correct of the purpose of 303 See Other
, just as described in RFC 7231 6.4.4.
This status code is applicable to any HTTP method. It is primarily
used to allow the output of a POST action to redirect the user agent
to a selected resource, since doing so provides the information
corresponding to the POST response in a form that can be separately
identified, bookmarked, and cached, independent of the original
request.
It seems your site is based on these POST requests and their redirects more than usual sites, thus exceeding the threshold defined in the 1m_redirects
template of NetData's conf.d/health.d/web_log.conf
. Easiest way would be to increase the thresholds on lines warn:
and crit:
, as the "(3xx except 304)" in the configuration is merely an info text, not part of the logic used for matching log lines:
template: 1m_redirects
on: web_log.response_statuses
families: *
lookup: sum -1m unaligned of redirects
calc: $this * 100 / $1m_requests
units: %
every: 10s
warn: ($1m_requests > 120) ? ($this > (($status >= $WARNING ) ? ( 1 ) : ( 20 )) ) : ( 0 )
crit: ($1m_requests > 120) ? ($this > (($status == $CRITICAL) ? ( 20 ) : ( 30 )) ) : ( 0 )
delay: up 2m down 15m multiplier 1.5 max 1h
info: the ratio of HTTP redirects (3xx except 304) over the last minute
to: webmaster
The special handling of 304 Not Modified
comes from the fact that it's truly comparable to 200 OK
:
RFC 7232, 4.1. 304 Not Modified
The 304 (Not Modified)
status code indicates that a conditional GET
or HEAD request has been received and would have resulted in a 200 (OK)
response if it were not for the fact that the condition
evaluated to false. In other words, there is no need for the server
to transfer a representation of the target resource because the
request indicates that the client, which made the request
conditional, already has a valid representation; the server is
therefore redirecting the client to make use of that stored
representation as if it were the payload of a 200 (OK) response.
This definition is followed correctly in python.d/web_log.chart.p
lines 746-761 and 906-921:
746/906: def get_data_per_statuses(self, code):
747/907: """
748/908: :param code: str: response status code. Ex.: '202', '499'
749/909: :return:
750/910: """
751/911: code_class = code[0]
752/912: if code_class == '2' or code == '304' or code_class == '1':
753/913: self.data['successful_requests'] += 1
754/914: elif code_class == '3':
755/915: self.data['redirects'] += 1
756/916: elif code_class == '4':
757/917: self.data['bad_requests'] += 1
758/918: elif code_class == '5':
759/919: self.data['server_errors'] += 1
760/920: else:
761/921: self.data['other_requests'] += 1
If you really wish to modify this to exclude 303
, then add or code == '303'
to lines 752 & 912.