diff --git a/services/identity/src/websockets/auth.rs b/services/identity/src/websockets/auth.rs --- a/services/identity/src/websockets/auth.rs +++ b/services/identity/src/websockets/auth.rs @@ -12,6 +12,7 @@ const PLACEHOLDER_CODE_VERSION: u64 = 0; const DEVICE_TYPE: &str = "service"; +#[tracing::instrument(skip_all)] async fn verify_user_access_token( user_id: &str, device_id: &str, @@ -50,6 +51,7 @@ Ok(response.into_inner().token_valid) } +#[tracing::instrument(skip_all)] pub async fn handle_auth_message(message: &str) -> Result<(), WebsocketError> { let auth_message = serde_json::from_str(message.trim()); diff --git a/services/identity/src/websockets/mod.rs b/services/identity/src/websockets/mod.rs --- a/services/identity/src/websockets/mod.rs +++ b/services/identity/src/websockets/mod.rs @@ -100,6 +100,7 @@ } } +#[tracing::instrument(skip_all)] pub async fn run_server() -> Result<(), errors::BoxedError> { let addr: SocketAddr = IDENTITY_SERVICE_WEBSOCKET_ADDR.parse()?; let listener = TcpListener::bind(&addr).await.expect("Failed to bind"); @@ -125,6 +126,7 @@ Ok(()) } +#[tracing::instrument(skip_all)] async fn send_search_request( url: &str, json_body: T, @@ -139,12 +141,14 @@ .await } +#[tracing::instrument(skip_all)] async fn close_connection(outgoing: WebsocketSink) { if let Err(e) = outgoing.lock().await.close().await { error!("Error closing connection: {}", e); } } +#[tracing::instrument(skip_all)] async fn handle_prefix_search( request_id: &str, prefix_request: identity_search_messages::IdentitySearchPrefix, @@ -183,6 +187,7 @@ Ok(search_result) } +#[tracing::instrument(skip_all)] async fn handle_websocket_frame( text: String, outgoing: WebsocketSink, @@ -222,6 +227,7 @@ } } +#[tracing::instrument(skip_all)] async fn accept_connection(hyper_ws: HyperWebsocket, addr: SocketAddr) { debug!("Incoming WebSocket connection from {}", addr); diff --git a/services/identity/src/websockets/send.rs b/services/identity/src/websockets/send.rs --- a/services/identity/src/websockets/send.rs +++ b/services/identity/src/websockets/send.rs @@ -11,6 +11,7 @@ pub type WebsocketSink = Arc, Message>>>; +#[tracing::instrument(skip_all)] pub async fn send_message(message: Message, outgoing: WebsocketSink) { if let Err(e) = outgoing.lock().await.send(message).await { error!("Failed to send message to device: {}", e);