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

Fix outbound federation request metrics #6795

Merged
merged 2 commits into from
Jan 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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