Generate and send uuid with analytics (#2790)

* Generate and send uuid with analytics

* go mod
This commit is contained in:
David Zhao
2024-06-13 23:00:50 -07:00
committed by GitHub
parent ea60368100
commit ecf1175832
3 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ require (
github.com/jxskiss/base62 v1.1.0
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1
github.com/livekit/mediatransportutil v0.0.0-20240613015318-84b69facfb75
github.com/livekit/protocol v1.17.1-0.20240606064424-fcde125058b2
github.com/livekit/protocol v1.17.1-0.20240614054716-725bc923f98b
github.com/livekit/psrpc v0.5.3-0.20240526192918-fbdaf10e6aa5
github.com/mackerelio/go-osstat v0.2.5
github.com/magefile/mage v1.15.0
+2 -2
View File
@@ -120,8 +120,8 @@ github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1 h1:jm09419p0lqTkD
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ=
github.com/livekit/mediatransportutil v0.0.0-20240613015318-84b69facfb75 h1:p60OjeixzXnhGFQL8wmdUwWPxijEDe9ZJFMosq+byec=
github.com/livekit/mediatransportutil v0.0.0-20240613015318-84b69facfb75/go.mod h1:jwKUCmObuiEDH0iiuJHaGMXwRs3RjrB4G6qqgkr/5oE=
github.com/livekit/protocol v1.17.1-0.20240606064424-fcde125058b2 h1:r6e2oEjmIR7PmeWpIzxImHJQU6gJ4gLwYlLH7NwVwVY=
github.com/livekit/protocol v1.17.1-0.20240606064424-fcde125058b2/go.mod h1:cN8WmGQR+kWz1+UWcAQdFFUcbW76PnfZDdkLAbYIqd4=
github.com/livekit/protocol v1.17.1-0.20240614054716-725bc923f98b h1:wRADQpZkCv2ml1W3PZCmFxJKdyAS4T1nleaAdv8rRpY=
github.com/livekit/protocol v1.17.1-0.20240614054716-725bc923f98b/go.mod h1:cN8WmGQR+kWz1+UWcAQdFFUcbW76PnfZDdkLAbYIqd4=
github.com/livekit/psrpc v0.5.3-0.20240526192918-fbdaf10e6aa5 h1:mTZyrjk5WEWMsvaYtJ42pG7DuxysKj21DKPINpGSIto=
github.com/livekit/psrpc v0.5.3-0.20240526192918-fbdaf10e6aa5/go.mod h1:CQUBSPfYYAaevg1TNCc6/aYsa8DJH4jSRFdCeSZk5u0=
github.com/mackerelio/go-osstat v0.2.5 h1:+MqTbZUhoIt4m8qzkVoXUJg1EuifwlAJSk4Yl2GXh+o=
+3
View File
@@ -23,6 +23,7 @@ import (
"github.com/livekit/protocol/livekit"
"github.com/livekit/protocol/logger"
"github.com/livekit/protocol/rpc"
"github.com/livekit/protocol/utils/guid"
"github.com/livekit/livekit-server/pkg/config"
"github.com/livekit/livekit-server/pkg/routing"
@@ -58,6 +59,7 @@ func (a *analyticsService) SendStats(_ context.Context, stats []*livekit.Analyti
}
for _, stat := range stats {
stat.Id = guid.New("AS_")
stat.AnalyticsKey = a.analyticsKey
stat.Node = a.nodeID
}
@@ -71,6 +73,7 @@ func (a *analyticsService) SendEvent(_ context.Context, event *livekit.Analytics
return
}
event.Id = guid.New("AE_")
event.NodeId = a.nodeID
event.AnalyticsKey = a.analyticsKey
if err := a.events.Send(&livekit.AnalyticsEvents{