Merge pull request #1071 from coreos-inc/500metric

Break out 5XX errors into their own metric
This commit is contained in:
josephschorr 2015-12-16 14:06:03 -05:00
commit d4e53406df

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