summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--changelog.d/13730.misc1
-rw-r--r--synapse/storage/databases/main/state.py2
2 files changed, 3 insertions, 0 deletions
diff --git a/changelog.d/13730.misc b/changelog.d/13730.misc
new file mode 100644
index 0000000000..06da6581a4
--- /dev/null
+++ b/changelog.d/13730.misc
@@ -0,0 +1 @@
+Instrument `get_metadata_for_events` for understandable traces in Jaeger.
diff --git a/synapse/storage/databases/main/state.py b/synapse/storage/databases/main/state.py
index e607ccfdc9..af7bebee80 100644
--- a/synapse/storage/databases/main/state.py
+++ b/synapse/storage/databases/main/state.py
@@ -23,6 +23,7 @@ from synapse.api.errors import NotFoundError, UnsupportedRoomVersionError
 from synapse.api.room_versions import KNOWN_ROOM_VERSIONS, RoomVersion
 from synapse.events import EventBase
 from synapse.events.snapshot import EventContext
+from synapse.logging.opentracing import trace
 from synapse.storage._base import SQLBaseStore
 from synapse.storage.database import (
     DatabasePool,
@@ -143,6 +144,7 @@ class StateGroupWorkerStore(EventsWorkerStore, SQLBaseStore):
 
         return room_version
 
+    @trace
     async def get_metadata_for_events(
         self, event_ids: Collection[str]
     ) -> Dict[str, EventMetadata]: