Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix outbound federation request metrics (#6795)
Browse files Browse the repository at this point in the history
* commit 'fcfb591b3':
  Fix outbound federation request metrics (#6795)
  • Loading branch information
anoadragon453 committed Mar 23, 2020
2 parents d115a4d + fcfb591 commit fea1e6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/6795.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix outbound federation request metrics.
4 changes: 4 additions & 0 deletions synapse/http/matrixfederationclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit fea1e6f

Please sign in to comment.