Fix incorrect unsubscribed track telemetry (#1350)
- only log unsubscribe on close if Track was actually bound - update subscribed counters even if a failure had been logged before
This commit is contained in:
@@ -260,10 +260,15 @@ func (t *telemetryService) TrackSubscribed(
|
||||
participantID livekit.ParticipantID,
|
||||
track *livekit.TrackInfo,
|
||||
publisher *livekit.ParticipantInfo,
|
||||
shouldSendEvent bool,
|
||||
) {
|
||||
t.enqueue(func() {
|
||||
prometheus.RecordTrackSubscribeSuccess(track.Type.String())
|
||||
|
||||
if !shouldSendEvent {
|
||||
return
|
||||
}
|
||||
|
||||
room := t.getRoomDetails(participantID)
|
||||
ev := newTrackEvent(livekit.AnalyticsEventType_TRACK_SUBSCRIBED, room, participantID, track)
|
||||
ev.Publisher = publisher
|
||||
|
||||
Reference in New Issue
Block a user