mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-17 04:43:49 +01:00
Add response code to response timer metrics
This commit is contained in:
parent
dab00faa83
commit
e45a46b6e4
1 changed files with 5 additions and 3 deletions
|
@ -38,7 +38,7 @@ outgoing_responses_counter = Counter(
|
|||
)
|
||||
|
||||
response_timer = Histogram(
|
||||
"synapse_http_server_response_time_seconds", "sec", ["method", "servlet", "tag"]
|
||||
"synapse_http_server_response_time_seconds", "sec", ["method", "servlet", "tag", "code"]
|
||||
)
|
||||
|
||||
response_ru_utime = Counter(
|
||||
|
@ -171,11 +171,13 @@ class RequestMetrics(object):
|
|||
)
|
||||
return
|
||||
|
||||
outgoing_responses_counter.labels(request.method, str(request.code)).inc()
|
||||
response_code = str(request.code)
|
||||
|
||||
outgoing_responses_counter.labels(request.method, response_code).inc()
|
||||
|
||||
response_count.labels(request.method, self.name, tag).inc()
|
||||
|
||||
response_timer.labels(request.method, self.name, tag).observe(
|
||||
response_timer.labels(request.method, self.name, tag, response_code).observe(
|
||||
time_sec - self.start
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue