Generate and send uuid with analytics (#2790)
* Generate and send uuid with analytics * go mod
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user