From 8c8985e8f2b2f55949f4c4c63dc702d215570698 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 27 Jul 2025 03:58:31 +0000 Subject: [PATCH] Add user_id to v3 sync span; add span for sync token association. Signed-off-by: Jason Volk --- src/api/client/sync/v3.rs | 1 + src/service/globals/mod.rs | 3 +++ src/service/rooms/user/mod.rs | 1 + 3 files changed, 5 insertions(+) diff --git a/src/api/client/sync/v3.rs b/src/api/client/sync/v3.rs index 2f97b888..aae5d8a2 100644 --- a/src/api/client/sync/v3.rs +++ b/src/api/client/sync/v3.rs @@ -115,6 +115,7 @@ type PresenceUpdates = HashMap; level = "debug", skip_all, fields( + user_id = %body.sender_user(), since = %body.body.since.as_deref().unwrap_or_default(), ) )] diff --git a/src/service/globals/mod.rs b/src/service/globals/mod.rs index 5d96325b..d9dae562 100644 --- a/src/service/globals/mod.rs +++ b/src/service/globals/mod.rs @@ -103,13 +103,16 @@ impl crate::Service for Service { impl Service { #[inline] + #[tracing::instrument(level = "trace", skip(self))] pub async fn wait_pending(&self) -> Result { self.db.wait_pending().await } #[inline] + #[tracing::instrument(level = "trace", skip(self))] pub async fn wait_count(&self, count: &u64) -> Result { self.db.wait_count(count).await } #[inline] #[must_use] + #[tracing::instrument(level = "debug", skip(self))] pub fn next_count(&self) -> data::Permit { self.db.next_count() } #[inline] diff --git a/src/service/rooms/user/mod.rs b/src/service/rooms/user/mod.rs index bc57d8f0..8e5c6246 100644 --- a/src/service/rooms/user/mod.rs +++ b/src/service/rooms/user/mod.rs @@ -97,6 +97,7 @@ pub async fn last_notification_read(&self, user_id: &UserId, room_id: &RoomId) - } #[implement(Service)] +#[tracing::instrument(level = "trace", skip(self))] pub async fn associate_token_shortstatehash( &self, room_id: &RoomId,