feat: add connection_errors_total metric tracking
Added recordConnectionError() function and integrated it into socket.ts
to track connection errors by type:
- connection_closed
- connection_lost
- connection_replaced
- timed_out
- logged_out
- bad_session
- restart_required
- multidevice_mismatch
- error_{code} for other status codes
This commit is contained in:
@@ -1922,6 +1922,18 @@ export function recordBufferOverflow(): void {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Record a connection error
|
||||
* Used by socket.ts when connection fails
|
||||
*/
|
||||
export function recordConnectionError(errorType: string): void {
|
||||
try {
|
||||
metrics.connectionErrors?.inc({ error_type: errorType })
|
||||
} catch {
|
||||
// Metrics not initialized, ignore silently
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Global Instance
|
||||
// ============================================
|
||||
|
||||
Reference in New Issue
Block a user