From a5f69a8be41d1b6d31cde67b48bfd33ca0481112 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 28 Jan 2020 16:41:31 +0000 Subject: [PATCH 1/2] Fix outbound federation request metrics --- synapse/http/matrixfederationclient.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py index 16765d54e009..6f1bb04d8b50 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py @@ -408,6 +408,8 @@ def _send_request( _sec_timeout, ) + outgoing_requests_counter.labels(method_bytes).inc() + try: with Measure(self.clock, "outbound_request"): # we don't want all the fancy cookie and redirect handling @@ -440,6 +442,8 @@ def _send_request( response.phrase.decode("ascii", errors="replace"), ) + incoming_responses_counter.labels(method_bytes, response.code).inc() + set_tag(tags.HTTP_STATUS_CODE, response.code) if 200 <= response.code < 300: From 3199a06631385e1acb3f9742764f1d8528435e16 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 28 Jan 2020 16:42:46 +0000 Subject: [PATCH 2/2] Newsfile --- changelog.d/6795.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/6795.bugfix diff --git a/changelog.d/6795.bugfix b/changelog.d/6795.bugfix new file mode 100644 index 000000000000..d1585653b149 --- /dev/null +++ b/changelog.d/6795.bugfix @@ -0,0 +1 @@ +Fix outbound federation request metrics.