File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -209,6 +209,8 @@ impl ClientConnection {
209209 let Ok ( fut) = fut_rx. await else { return } ;
210210
211211 let _gauge_guard = WORKER_METRICS . connected_clients . with_label_values ( & db) . inc_scope ( ) ;
212+ WORKER_METRICS . ws_clients_spawned . with_label_values ( & db) . inc ( ) ;
213+ scopeguard:: defer!( WORKER_METRICS . ws_clients_aborted. with_label_values( & db) . inc( ) ) ;
212214
213215 fut. await
214216 } )
Original file line number Diff line number Diff line change @@ -15,6 +15,16 @@ metrics_group!(
1515 #[ labels( database_identity: Identity ) ]
1616 pub connected_clients: IntGaugeVec ,
1717
18+ #[ name = spacetime_worker_ws_clients_spawned]
19+ #[ help = "Number of new ws client connections spawned. Counted after any on_connect reducers are run." ]
20+ #[ labels( database_identity: Identity ) ]
21+ pub ws_clients_spawned: IntGaugeVec ,
22+
23+ #[ name = spacetime_worker_ws_clients_aborted]
24+ #[ help = "Number of ws client connections aborted" ]
25+ #[ labels( database_identity: Identity ) ]
26+ pub ws_clients_aborted: IntGaugeVec ,
27+
1828 #[ name = spacetime_websocket_requests_total]
1929 #[ help = "The cumulative number of websocket request messages" ]
2030 #[ labels( replica_id: u64 , protocol: str ) ]
You can’t perform that action at this time.
0 commit comments