Add country label to edge prom stats. (#3816)
* Add country label to edge prom stats. * data channel country stats * test * pub/sub time country
This commit is contained in:
+15
-1
@@ -205,6 +205,7 @@ type ParticipantParams struct {
|
||||
FireOnTrackBySdp bool
|
||||
DisableCodecRegression bool
|
||||
LastPubReliableSeq uint32
|
||||
Country string
|
||||
}
|
||||
|
||||
type ParticipantImpl struct {
|
||||
@@ -379,6 +380,7 @@ func NewParticipant(params ParticipantParams) (*ParticipantImpl, error) {
|
||||
|
||||
p.id.Store(params.SID)
|
||||
p.dataChannelStats = telemetry.NewBytesTrackStats(
|
||||
p.params.Country,
|
||||
telemetry.BytesTrackIDForParticipantID(telemetry.BytesTrackTypeData, p.ID()),
|
||||
p.ID(),
|
||||
params.Telemetry,
|
||||
@@ -436,6 +438,10 @@ func NewParticipant(params ParticipantParams) (*ParticipantImpl, error) {
|
||||
return p, nil
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) GetCountry() string {
|
||||
return p.params.Country
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) GetTrailer() []byte {
|
||||
trailer := make([]byte, len(p.params.Trailer))
|
||||
copy(trailer, p.params.Trailer)
|
||||
@@ -2947,7 +2953,14 @@ func (p *ParticipantImpl) mediaTrackReceived(track sfu.TrackRemote, rtpReceiver
|
||||
)
|
||||
}
|
||||
|
||||
prometheus.RecordPublishTime(mt.Source(), mt.Kind(), pubTime, p.GetClientInfo().GetSdk(), p.Kind())
|
||||
prometheus.RecordPublishTime(
|
||||
p.params.Country,
|
||||
mt.Source(),
|
||||
mt.Kind(),
|
||||
pubTime,
|
||||
p.GetClientInfo().GetSdk(),
|
||||
p.Kind(),
|
||||
)
|
||||
p.handleTrackPublished(mt, isMigrated)
|
||||
}()
|
||||
}
|
||||
@@ -3015,6 +3028,7 @@ func (p *ParticipantImpl) addMediaTrack(signalCid string, sdpCid string, ti *liv
|
||||
ParticipantID: p.ID,
|
||||
ParticipantIdentity: p.params.Identity,
|
||||
ParticipantVersion: p.version.Load(),
|
||||
ParticipantCountry: p.params.Country,
|
||||
BufferFactory: p.params.Config.BufferFactory,
|
||||
ReceiverConfig: p.params.Config.Receiver,
|
||||
AudioConfig: p.params.AudioConfig,
|
||||
|
||||
Reference in New Issue
Block a user