diff --git a/core/notifications/src/executor/fcm/mod.rs b/core/notifications/src/executor/fcm/mod.rs index 6c2d8ea055b..16165d233af 100644 --- a/core/notifications/src/executor/fcm/mod.rs +++ b/core/notifications/src/executor/fcm/mod.rs @@ -8,6 +8,7 @@ use google_fcm1::{ oauth2::{self, ServiceAccountKey}, FirebaseCloudMessaging, }; +use tracing::instrument; use std::collections::{HashMap, HashSet}; @@ -60,6 +61,7 @@ impl FcmClient { }) } + #[instrument(name = "fcm_client.send", skip(self, deep_link, device_tokens), err)] pub async fn send( &self, device_tokens: HashSet, diff --git a/core/notifications/src/executor/mod.rs b/core/notifications/src/executor/mod.rs index c95c4e7428d..1b5d4f84723 100644 --- a/core/notifications/src/executor/mod.rs +++ b/core/notifications/src/executor/mod.rs @@ -2,12 +2,13 @@ mod config; pub mod error; mod fcm; -use fcm::FcmClient; +use tracing::instrument; use crate::{notification_event::*, primitives::*, user_notification_settings::*}; pub use config::*; use error::*; +use fcm::FcmClient; #[derive(Clone)] pub struct Executor { @@ -28,6 +29,7 @@ impl Executor { }) } + #[instrument(name = "executor.notify", skip(self, event), err)] pub async fn notify(&self, event: T) -> Result<(), ExecutorError> { let settings = self.settings.find_for_user_id(event.user_id()).await?; if !settings.should_send_notification( diff --git a/core/notifications/src/messages/mod.rs b/core/notifications/src/messages/mod.rs index 0b34a435393..1dcfaef2e59 100644 --- a/core/notifications/src/messages/mod.rs +++ b/core/notifications/src/messages/mod.rs @@ -2,6 +2,7 @@ use rust_i18n::t; use crate::{notification_event::*, primitives::*}; +#[derive(Debug)] pub struct LocalizedMessage { pub title: String, pub body: String,