exclude sip client from track publish metric (#3007)

This commit is contained in:
cnderrauber
2024-09-17 09:42:21 +08:00
committed by GitHub
parent 002c73dad3
commit 0c002b8675
+7 -1
View File
@@ -2133,7 +2133,13 @@ func (p *ParticipantImpl) mediaTrackReceived(track *webrtc.TrackRemote, rtpRecei
"track", logger.Proto(mt.ToProto()),
"cost", pubTime.Milliseconds(),
)
prometheus.RecordPublishTime(mt.Source(), mt.Kind(), pubTime)
// SIP client relies on the remote peer's media packet to publish the track and
// sometimes it costs 10s to arrive after handshake.
// So we ignore the publish time for SIP client to avoid the high value in the metrics.
if p.Kind() != livekit.ParticipantInfo_SIP {
prometheus.RecordPublishTime(mt.Source(), mt.Kind(), pubTime)
}
p.handleTrackPublished(mt)
}()
}