Add sdk, participant_kind to pub sub metrics (#3023)

* exclude go client from track publication metric

* add sdk,participant_kind lables

* fix test
This commit is contained in:
cnderrauber
2024-09-19 10:42:47 +08:00
committed by GitHub
parent 3ecd03fa31
commit 978db00034
4 changed files with 21 additions and 13 deletions
+1 -6
View File
@@ -2131,12 +2131,7 @@ func (p *ParticipantImpl) mediaTrackReceived(track *webrtc.TrackRemote, rtpRecei
"cost", pubTime.Milliseconds(),
)
// 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)
}
prometheus.RecordPublishTime(mt.Source(), mt.Kind(), pubTime, p.GetClientInfo().GetSdk(), p.Kind())
p.handleTrackPublished(mt)
}()
}