Instrument FederationStateIdsServlet - /state_ids (#13499)

Instrument FederationStateIdsServlet - `/state_ids` so it's easier to follow what's going on in Jaeger when viewing a trace.
This commit is contained in:
Eric Eastwood 2022-08-15 13:41:23 -05:00 committed by GitHub
parent 19e5d44886
commit 344a2f767c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 2 deletions

View file

@ -27,6 +27,7 @@ from synapse.logging.context import (
make_deferred_yieldable,
run_in_background,
)
from synapse.logging.opentracing import start_active_span
from synapse.util import Clock
if typing.TYPE_CHECKING:
@ -176,8 +177,11 @@ class _PerHostRatelimiter:
# Ensure that we've properly cleaned up.
self.sleeping_requests.discard(request_id)
self.ready_request_queue.pop(request_id, None)
wait_span_scope.__exit__(None, None, None)
return r
wait_span_scope = start_active_span("ratelimit wait")
wait_span_scope.__enter__()
ret_defer.addCallbacks(on_start, on_err)
ret_defer.addBoth(on_both)
return make_deferred_yieldable(ret_defer)