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
+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{