summary refs log tree commit diff
path: root/synapse/http/request_metrics.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-07-18 13:59:36 +0100
committerErik Johnston <erik@matrix.org>2018-07-18 13:59:36 +0100
commite45a46b6e4990befe6567aaf26354320dce4337a (patch)
tree16c73b8f3f73b4b7623d9c10b86f1242ca707bb7 /synapse/http/request_metrics.py
parentMerge pull request #3367 from matrix-org/rav/drop_re_signing_hacks (diff)
downloadsynapse-e45a46b6e4990befe6567aaf26354320dce4337a.tar.xz
Add response code to response timer metrics
Diffstat (limited to 'synapse/http/request_metrics.py')
-rw-r--r--synapse/http/request_metrics.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/http/request_metrics.py b/synapse/http/request_metrics.py
index f24b4b949c..c029a69ee5 100644
--- a/synapse/http/request_metrics.py
+++ b/synapse/http/request_metrics.py
@@ -38,7 +38,7 @@ outgoing_responses_counter = Counter(
 )
 
 response_timer = Histogram(
-    "synapse_http_server_response_time_seconds", "sec", ["method", "servlet", "tag"]
+    "synapse_http_server_response_time_seconds", "sec", ["method", "servlet", "tag", "code"]
 )
 
 response_ru_utime = Counter(
@@ -171,11 +171,13 @@ class RequestMetrics(object):
                 )
                 return
 
-        outgoing_responses_counter.labels(request.method, str(request.code)).inc()
+        response_code = str(request.code)
+
+        outgoing_responses_counter.labels(request.method, response_code).inc()
 
         response_count.labels(request.method, self.name, tag).inc()
 
-        response_timer.labels(request.method, self.name, tag).observe(
+        response_timer.labels(request.method, self.name, tag, response_code).observe(
             time_sec - self.start
         )