Break out 5XX errors into their own metric

First part of #983
This commit is contained in:
Joseph Schorr 2015-12-16 13:52:08 -05:00
parent 50f4612c72
commit 63a8b197e4

View file

@ -53,7 +53,10 @@ def time_after_request(name, metric_queue):
metric_queue.put('ResponseTime', dur, dimensions=dims, unit='Seconds')
metric_queue.put('ResponseCode', r.status_code, dimensions=dims)
if r.status_code < 200 or r.status_code >= 300:
if r.status_code >= 500:
metric_queue.put('5XXResponse', 1, dimensions={'name': name})
elif r.status_code < 200 or r.status_code >= 300:
metric_queue.put('Non200Response', 1, dimensions={'name': name})
return r