Skip to content

Commit

Permalink
Log when the WebSocket starts and ends
Browse files Browse the repository at this point in the history
  • Loading branch information
shepmaster committed Nov 13, 2024
1 parent f2a056e commit c79a2c4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/src/server_axum/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use tokio::{
time,
};
use tokio_util::sync::CancellationToken;
use tracing::{error, instrument, warn, Instrument};
use tracing::{error, info, instrument, warn, Instrument};

#[derive(Debug, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "camelCase")]
Expand Down Expand Up @@ -210,9 +210,11 @@ pub(crate) async fn handle(

let id = WEBSOCKET_ID.fetch_add(1, Ordering::SeqCst);
tracing::Span::current().record("ws_id", &id);
info!("WebSocket started");

handle_core(socket, factory, feature_flags, db).await;

info!("WebSocket ending");
metrics::LIVE_WS.dec();
let elapsed = start.elapsed();
metrics::DURATION_WS.observe(elapsed.as_secs_f64());
Expand Down

0 comments on commit c79a2c4

Please sign in to comment.