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:
Raja Subramanian
2025-07-24 13:23:05 +05:30
committed by GitHub
parent 68387b41fe
commit 10103449c5
12 changed files with 268 additions and 116 deletions
+9 -2
View File
@@ -210,10 +210,17 @@ func (t *MediaTrackSubscriptions) AddSubscriber(sub types.LocalParticipant, wr *
subTrack.SetPublisherMuted(t.params.MediaTrack.IsMuted())
})
statsKey := telemetry.StatsKeyForTrack(
sub.GetCountry(),
livekit.StreamType_DOWNSTREAM,
subscriberID,
trackID,
t.params.MediaTrack.Source(),
t.params.MediaTrack.Kind(),
)
reporter := sub.GetReporter().WithTrack(trackID.String())
downTrack.OnStatsUpdate(func(_ *sfu.DownTrack, stat *livekit.AnalyticsStat) {
key := telemetry.StatsKeyForTrack(livekit.StreamType_DOWNSTREAM, subscriberID, trackID, t.params.MediaTrack.Source(), t.params.MediaTrack.Kind())
t.params.Telemetry.TrackStats(key, stat)
t.params.Telemetry.TrackStats(statsKey, stat)
if cs, ok := telemetry.CondenseStat(stat); ok {
ti := wr.TrackInfo()