Fix outbound federation request metrics (#6795)

This commit is contained in:
Erik Johnston 2020-01-28 18:59:48 +00:00 committed by GitHub
parent cc109b79dd
commit fcfb591b31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

1
changelog.d/6795.bugfix Normal file
View File

@ -0,0 +1 @@
Fix outbound federation request metrics.

View File

@ -408,6 +408,8 @@ class MatrixFederationHttpClient(object):
_sec_timeout, _sec_timeout,
) )
outgoing_requests_counter.labels(method_bytes).inc()
try: try:
with Measure(self.clock, "outbound_request"): with Measure(self.clock, "outbound_request"):
# we don't want all the fancy cookie and redirect handling # we don't want all the fancy cookie and redirect handling
@ -440,6 +442,8 @@ class MatrixFederationHttpClient(object):
response.phrase.decode("ascii", errors="replace"), response.phrase.decode("ascii", errors="replace"),
) )
incoming_responses_counter.labels(method_bytes, response.code).inc()
set_tag(tags.HTTP_STATUS_CODE, response.code) set_tag(tags.HTTP_STATUS_CODE, response.code)
if 200 <= response.code < 300: if 200 <= response.code < 300: