Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion crates/client-api/src/routes/subscribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,15 @@ async fn ws_client_actor_inner(

// if this is the closed-by-them case, let the ClientConnectionSenders know now.
sendrx.close();
closed = true;
log::trace!("Close frame {:?}", close_frame);
if !closed {
// This is the client telling us they want to close.
WORKER_METRICS
.ws_clients_closed_connection
.with_label_values(&addr)
Comment thread
joshua-spacetime marked this conversation as resolved.
.inc();
}
closed = true;
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion crates/core/src/worker_metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ metrics_group!(
pub ws_clients_spawned: IntGaugeVec,

#[name = spacetime_worker_ws_clients_aborted]
#[help = "Number of ws client connections aborted"]
#[help = "Number of ws client connections aborted by either the server or the client"]
#[labels(database_identity: Identity)]
pub ws_clients_aborted: IntGaugeVec,

#[name = spacetime_worker_ws_clients_closed_connection]
#[help = "Number of ws client connections closed by the client as opposed to being termiated by the server"]
#[labels(database_identity: Identity)]
pub ws_clients_closed_connection: IntGaugeVec,

#[name = spacetime_websocket_requests_total]
#[help = "The cumulative number of websocket request messages"]
#[labels(database_identity: Identity, protocol: str)]
Expand Down
Loading