Skip to content

Commit

Permalink
Fix b'GET' in prometheus metrics (matrix-org#7503)
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh authored and phil-flex committed Jun 16, 2020
1 parent 83c0e1f commit cf8c393
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/7503.bugfix
@@ -0,0 +1 @@
Fix incorrect `method` label on `synapse_http_matrixfederationclient_{requests,responses}` prometheus metrics.
6 changes: 4 additions & 2 deletions synapse/http/matrixfederationclient.py
Expand Up @@ -408,7 +408,7 @@ def _send_request(
_sec_timeout,
)

outgoing_requests_counter.labels(method_bytes).inc()
outgoing_requests_counter.labels(request.method).inc()

try:
with Measure(self.clock, "outbound_request"):
Expand All @@ -434,7 +434,9 @@ def _send_request(
logger.info("Failed to send request: %s", e)
raise_from(RequestSendFailed(e, can_retry=True), e)

incoming_responses_counter.labels(method_bytes, response.code).inc()
incoming_responses_counter.labels(
request.method, response.code
).inc()

set_tag(tags.HTTP_STATUS_CODE, response.code)

Expand Down

0 comments on commit cf8c393

Please sign in to comment.