1 files changed, 7 insertions, 3 deletions
diff --git a/synapse/http/client.py b/synapse/http/client.py
index 01737a7188..2ae1c4d3a4 100644
--- a/synapse/http/client.py
+++ b/synapse/http/client.py
@@ -34,11 +34,13 @@ logger = logging.getLogger(__name__)
metrics = synapse.metrics.get_metrics_for(__name__)
-outgoing_requests_counter = metrics.register_counter("requests",
+outgoing_requests_counter = metrics.register_counter(
+ "requests",
labels=["method"],
)
-incoming_responses_counter = metrics.register_counter("responses",
- labels=["method","code"],
+incoming_responses_counter = metrics.register_counter(
+ "responses",
+ labels=["method", "code"],
)
@@ -64,9 +66,11 @@ class SimpleHttpClient(object):
def _cb(response):
incoming_responses_counter.inc(method, response.code)
return response
+
def _eb(failure):
incoming_responses_counter.inc(method, "ERR")
return failure
+
d.addCallbacks(_cb, _eb)
return d
|