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
2 changes: 2 additions & 0 deletions crates/core/src/client/client_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ impl ClientConnection {
let Ok(fut) = fut_rx.await else { return };

let _gauge_guard = WORKER_METRICS.connected_clients.with_label_values(&db).inc_scope();
WORKER_METRICS.ws_clients_spawned.with_label_values(&db).inc();
scopeguard::defer!(WORKER_METRICS.ws_clients_aborted.with_label_values(&db).inc());

fut.await
})
Expand Down
10 changes: 10 additions & 0 deletions crates/core/src/worker_metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ metrics_group!(
#[labels(database_identity: Identity)]
pub connected_clients: IntGaugeVec,

#[name = spacetime_worker_ws_clients_spawned]
#[help = "Number of new ws client connections spawned. Counted after any on_connect reducers are run."]
#[labels(database_identity: Identity)]
pub ws_clients_spawned: IntGaugeVec,

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

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