From 01ed0c10a0bd022b07ce1c8b637e9b4274e66b78 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Mon, 3 Feb 2025 11:04:56 +0000 Subject: [PATCH] Merge pull request #23317 from overleaf/bg-improve-real-time-ping-logs Add connection details to real-time ping logs GitOrigin-RevId: f993d71deb1a512295af6c7146a19b730742e33f --- services/real-time/app/js/Router.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/services/real-time/app/js/Router.js b/services/real-time/app/js/Router.js index cb79d367cd..a7582be210 100644 --- a/services/real-time/app/js/Router.js +++ b/services/real-time/app/js/Router.js @@ -235,6 +235,14 @@ module.exports = Router = { user = { _id: 'anonymous-user', anonymousAccessToken } } + const connectionDetails = { + userId: user._id, + projectId, + remoteIp: client.remoteIp, + publicId: client.publicId, + clientId: client.id, + } + let pingTimestamp let pingId = -1 let pongId = -1 @@ -243,8 +251,7 @@ module.exports = Router = { if (pongId !== pingId) { logger.warn( { - publicId: client.publicId, - clientId: client.id, + ...connectionDetails, pingId, pongId, lastPingTimestamp: pingTimestamp, @@ -262,8 +269,7 @@ module.exports = Router = { if (receivedPingId !== pingId) { logger.warn( { - publicId: client.publicId, - clientId: client.id, + ...connectionDetails, receivedPingId, pingId, sentTimestamp, @@ -279,8 +285,7 @@ module.exports = Router = { ) { logger.warn( { - publicId: client.publicId, - clientId: client.id, + ...connectionDetails, receivedPingId, pingId, sentTimestamp,