Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MM-59070] Add telemetry events for host controls #831

Merged
merged 10 commits into from
Aug 13, 2024
14 changes: 14 additions & 0 deletions server/host_controls.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ func (p *Plugin) changeHost(requesterID, channelID, newHostID string) error {
UserIDs: getUserIDsFromSessions(state.sessions),
})

p.track(evHostChangeHost, nil)

return nil
}

Expand Down Expand Up @@ -102,6 +104,8 @@ func (p *Plugin) muteSession(requesterID, channelID, sessionID string) error {
"session_id": sessionID,
}, &WebSocketBroadcast{UserID: ust.UserID, ReliableClusterSend: true})

p.track(evHostMuteParticipant, nil)

return nil
}

Expand Down Expand Up @@ -132,6 +136,8 @@ func (p *Plugin) muteOthers(requesterID, channelID string) error {
}
}

p.track(evHostMuteOthers, nil)

return nil
}

Expand Down Expand Up @@ -165,6 +171,8 @@ func (p *Plugin) screenOff(requesterID, channelID, sessionID string) error {
"session_id": sessionID,
}, &WebSocketBroadcast{UserID: ust.UserID, ReliableClusterSend: true})

p.track(evHostStopScreenshare, nil)

return nil
}

Expand Down Expand Up @@ -200,6 +208,8 @@ func (p *Plugin) lowerHand(requesterID, channelID, sessionID string) error {
"host_id": requesterID,
}, &WebSocketBroadcast{UserID: ust.UserID, ReliableClusterSend: true})

p.track(evHostLowerHand, nil)

return nil
}

Expand Down Expand Up @@ -237,6 +247,8 @@ func (p *Plugin) hostRemoveSession(requesterID, channelID, sessionID string) err
UserIDs: getUserIDsFromSessions(state.sessions),
})

p.track(evHostRemoveParticipant, nil)

go func() {
// Wait a few seconds for the client to end their session cleanly. If they don't (like for an
// older mobile client) then forcibly end it.
Expand Down Expand Up @@ -313,5 +325,7 @@ func (p *Plugin) hostEnd(requesterID, channelID string) error {
}
}()

p.track(evHostEndCall, nil)

return nil
}
22 changes: 18 additions & 4 deletions server/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ const (
evCallUserLeft = "call_user_left"
evCallNotifyAdmin = "call_notify_admin"
evCallConcurrentSessionsWarning = "call_concurrent_sessions_warning"
evHostChangeHost = "host_change_host"
evHostMuteParticipant = "host_mute_participant"
evHostMuteOthers = "host_mute_others"
evHostStopScreenshare = "host_stop_screenshare"
evHostLowerHand = "host_lower_hand"
evHostRemoveParticipant = "host_remove_participant"
evHostEndCall = "host_end_call"
)

var (
Expand All @@ -31,10 +38,17 @@ var (
// We only need to map events that require a SKU (i.e., licensed features). Anything available on unlicensed
// servers will map to null as expected.
eventToSkusMap = map[string][]string{
"user_start_recording": enterpriseSKUs,
"user_stop_recording": enterpriseSKUs,
"live_captions_on": enterpriseSKUs,
"live_captions_off": enterpriseSKUs,
"user_start_recording": enterpriseSKUs,
"user_stop_recording": enterpriseSKUs,
"live_captions_on": enterpriseSKUs,
"live_captions_off": enterpriseSKUs,
evHostChangeHost: professionalSKUs,
evHostMuteParticipant: professionalSKUs,
evHostMuteOthers: professionalSKUs,
evHostStopScreenshare: professionalSKUs,
evHostLowerHand: professionalSKUs,
evHostRemoveParticipant: professionalSKUs,
evHostEndCall: professionalSKUs,
}
)

Expand Down
Loading