diff --git a/pkg/rtc/participant.go b/pkg/rtc/participant.go index f08370514..a22f0b17f 100644 --- a/pkg/rtc/participant.go +++ b/pkg/rtc/participant.go @@ -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) }() }