summary refs log tree commit diff
path: root/synapse/federation/federation_client.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-08-02 14:30:46 +0100
committerErik Johnston <erik@matrix.org>2021-08-02 14:30:46 +0100
commit0ee0d7b4602edd4a755ba7c5257b86c70cd5683a (patch)
treebe808a88bb8f76b09a0521b759fc934dd3118749 /synapse/federation/federation_client.py
parentAllow setting transaction limit for db connections (#10440) (diff)
downloadsynapse-0ee0d7b4602edd4a755ba7c5257b86c70cd5683a.tar.xz
Add extra spans to remote join path
Diffstat (limited to 'synapse/federation/federation_client.py')
-rw-r--r--synapse/federation/federation_client.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/synapse/federation/federation_client.py b/synapse/federation/federation_client.py
index b7a10da15a..a837c18726 100644
--- a/synapse/federation/federation_client.py
+++ b/synapse/federation/federation_client.py
@@ -55,6 +55,7 @@ from synapse.api.room_versions import (
 from synapse.events import EventBase, builder
 from synapse.federation.federation_base import FederationBase, event_from_pdu_json
 from synapse.federation.transport.client import SendJoinResponse
+from synapse.logging.opentracing import start_active_span
 from synapse.logging.utils import log_function
 from synapse.types import JsonDict, get_domain_from_id
 from synapse.util.async_helpers import concurrently_execute
@@ -732,7 +733,8 @@ class FederationClient(FederationBase):
         """
 
         async def send_request(destination) -> SendJoinResult:
-            response = await self._do_send_join(room_version, destination, pdu)
+            with start_active_span("_do_send_join"):
+                response = await self._do_send_join(room_version, destination, pdu)
 
             # If an event was returned (and expected to be returned):
             #
@@ -792,19 +794,21 @@ class FederationClient(FederationBase):
             valid_pdus_map: Dict[str, EventBase] = {}
 
             async def _execute(pdu: EventBase) -> None:
-                valid_pdu = await self._check_sigs_and_hash_and_fetch_one(
-                    pdu=pdu,
-                    origin=destination,
-                    outlier=True,
-                    room_version=room_version,
-                )
+                with start_active_span("_check_sigs_and_hash_and_fetch_one"):
+                    valid_pdu = await self._check_sigs_and_hash_and_fetch_one(
+                        pdu=pdu,
+                        origin=destination,
+                        outlier=True,
+                        room_version=room_version,
+                    )
 
                 if valid_pdu:
                     valid_pdus_map[valid_pdu.event_id] = valid_pdu
 
-            await concurrently_execute(
-                _execute, itertools.chain(state, auth_chain), 10000
-            )
+            with start_active_span("check_sigs"):
+                await concurrently_execute(
+                    _execute, itertools.chain(state, auth_chain), 10000
+                )
 
             # NB: We *need* to copy to ensure that we don't have multiple
             # references being passed on, as that causes... issues.