summary refs log tree commit diff
path: root/synapse/storage/databases/main/state_deltas.py
diff options
context:
space:
mode:
authorEric Eastwood <eric.eastwood@beta.gouv.fr>2024-08-06 11:43:43 -0500
committerGitHub <noreply@github.com>2024-08-06 11:43:43 -0500
commit1dfa59b238cee0dc62163588cc9481896c288979 (patch)
treeed1abf370c20b0853b48aecf466de2da4f282f8c /synapse/storage/databases/main/state_deltas.py
parentMerge branch 'release-v1.113' into develop (diff)
downloadsynapse-1dfa59b238cee0dc62163588cc9481896c288979.tar.xz
Sliding Sync: Add more tracing (#17514)
Spawning from looking at a couple traces and wanting a little more info.

Follow-up to github.com/element-hq/synapse/pull/17501

The changes in this PR allow you to find slow Sliding Sync traces ignoring the
`wait_for_events` time. In Jaeger, you can now filter for the `current_sync_for_user`
operation with `RESULT.result=true` indicating that it actually returned non-empty results.

If you want to find traces for your own user, you can use
`RESULT.result=true ARG.sync_config.user="@madlittlemods:matrix.org"`
Diffstat (limited to 'synapse/storage/databases/main/state_deltas.py')
-rw-r--r--synapse/storage/databases/main/state_deltas.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/synapse/storage/databases/main/state_deltas.py b/synapse/storage/databases/main/state_deltas.py
index da3ebe66b8..9ed39e688a 100644
--- a/synapse/storage/databases/main/state_deltas.py
+++ b/synapse/storage/databases/main/state_deltas.py
@@ -24,6 +24,7 @@ from typing import List, Optional, Tuple
 
 import attr
 
+from synapse.logging.opentracing import trace
 from synapse.storage._base import SQLBaseStore
 from synapse.storage.database import LoggingTransaction
 from synapse.storage.databases.main.stream import _filter_results_by_stream
@@ -159,6 +160,7 @@ class StateDeltasStore(SQLBaseStore):
             self._get_max_stream_id_in_current_state_deltas_txn,
         )
 
+    @trace
     async def get_current_state_deltas_for_room(
         self, room_id: str, from_token: RoomStreamToken, to_token: RoomStreamToken
     ) -> List[StateDelta]: