Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

πŸ“ˆ(frontend) include LiveKit SIDs in the connection analytics event

lebaudantoinee0ab7f191f92
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e28dcbb1..a2feb80b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,7 @@ and this project adheres to
### Changed
+- πŸ“ˆ(frontend) include LiveKit SIDs in the connection analytics event
- πŸ”‡(backend) silence expected 401 warnings on /me
- πŸ”‡(backend) silence noisy request summary info logs
diff --git a/src/frontend/src/features/rooms/livekit/components/ConnectionObserver.tsx b/src/frontend/src/features/rooms/livekit/components/ConnectionObserver.tsx
index 4cd846ce..9eea1da0 100644
--- a/src/frontend/src/features/rooms/livekit/components/ConnectionObserver.tsx
+++ b/src/frontend/src/features/rooms/livekit/components/ConnectionObserver.tsx
@@ -71,20 +71,30 @@ export const ConnectionObserver = () => {
useEffect(() => {
if (!isAnalyticsEnabled) return
- const handleConnection = () => {
+ const handleConnection = async () => {
// Preserve original connection timestamp across reconnections to measure
// total session duration from first connect to final disconnect.
if (connectionStartTimeRef.current != null) return
connectionStartTimeRef.current = Date.now()
- void captureMediaEvent('connection-event', {})
+ const participantSid = room.localParticipant.sid
+ const roomSid = await room.getSid().catch(() => undefined)
+ void captureMediaEvent('connection-event', {
+ livekit_room_sid: roomSid,
+ livekit_participant_sid: participantSid,
+ })
}
const handleReconnect = () => {
captureEvent('reconnect-event')
}
- const handleReconnected = () => {
- captureEvent('reconnected-event')
+ const handleReconnected = async () => {
+ const participantSid = room.localParticipant.sid
+ const roomSid = await room.getSid().catch(() => undefined)
+ captureEvent('reconnected-event', {
+ livekit_room_sid: roomSid,
+ livekit_participant_sid: participantSid,
+ })
}
const handleSignalingConnect = () => {