[MM-59363] Shared channel event telemetry (#29024)
* shared channel event tracking * Update notification.go Co-authored-by: Miguel de la Cruz <miguel@mcrx.me> --------- Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
373e21c5a1
Коммит
751d84bf13
@@ -2698,6 +2698,17 @@ func (a *App) SetActiveChannel(c request.CTX, userID string, channelID string) *
|
||||
},
|
||||
)
|
||||
}
|
||||
isShared, shErr := a.Srv().Store().SharedChannel().HasChannel(channelID)
|
||||
if shErr == nil && isShared {
|
||||
a.Srv().telemetryService.SendTelemetryForFeature(
|
||||
telemetry.TrackSharedChannelsFeature,
|
||||
"shared_channel_viewed",
|
||||
map[string]any{
|
||||
telemetry.TrackPropertyUser: userID,
|
||||
telemetry.TrackPropertyChannel: channelID,
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@@ -879,6 +879,9 @@ func (a *App) SendNotifications(c request.CTX, post *model.Post, team *model.Tea
|
||||
)
|
||||
}
|
||||
}
|
||||
if user.IsRemote() {
|
||||
a.Srv().telemetryService.SendTelemetryForFeature(telemetry.TrackSharedChannelsFeature, "mentioned_remote_user", map[string]any{telemetry.TrackPropertyUser: user.Id, telemetry.TrackPropertyPostAuthor: sender.Id})
|
||||
}
|
||||
}
|
||||
for groupId := range mentions.GroupMentions {
|
||||
a.Srv().telemetryService.SendTelemetryForFeature(telemetry.TrackGroupsFeature, "post_mentioned_custom_group", map[string]any{telemetry.TrackPropertyUser: sender.Id, telemetry.TrackPropertyGroup: groupId, "group_size": groups[groupId].MemberCount})
|
||||
|
||||
@@ -97,6 +97,21 @@ func (a *App) CreatePostAsUser(c request.CTX, post *model.Post, currentSessionId
|
||||
}
|
||||
}
|
||||
|
||||
if channel.IsShared() {
|
||||
// if not marked as shared we don't try to reach the store, but needs double checking as it might not be truly shared
|
||||
isShared, shErr := a.Srv().Store().SharedChannel().HasChannel(channel.Id)
|
||||
if shErr == nil && isShared {
|
||||
a.Srv().telemetryService.SendTelemetryForFeature(
|
||||
telemetry.TrackSharedChannelsFeature,
|
||||
"shared_channel_posted",
|
||||
map[string]any{
|
||||
telemetry.TrackPropertyUser: post.UserId,
|
||||
telemetry.TrackPropertyChannel: channel.Id,
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return rp, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -103,9 +103,10 @@ const (
|
||||
type TrackFeature string
|
||||
|
||||
const (
|
||||
TrackGuestFeature TrackFeature = "guest_accounts"
|
||||
TrackGroupsFeature TrackFeature = "custom_groups"
|
||||
TrackReadOnlyFeature TrackFeature = "read_only_channels"
|
||||
TrackGuestFeature TrackFeature = "guest_accounts"
|
||||
TrackGroupsFeature TrackFeature = "custom_groups"
|
||||
TrackReadOnlyFeature TrackFeature = "read_only_channels"
|
||||
TrackSharedChannelsFeature TrackFeature = "shared_channels"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -147,9 +148,10 @@ type EventFeature struct {
|
||||
}
|
||||
|
||||
var featureSKUS = map[TrackFeature][]TrackSKU{
|
||||
TrackGuestFeature: {TrackProfessionalSKU, TrackEnterpriseSKU},
|
||||
TrackGroupsFeature: {TrackProfessionalSKU, TrackEnterpriseSKU},
|
||||
TrackReadOnlyFeature: {TrackProfessionalSKU, TrackEnterpriseSKU},
|
||||
TrackGuestFeature: {TrackProfessionalSKU, TrackEnterpriseSKU},
|
||||
TrackGroupsFeature: {TrackProfessionalSKU, TrackEnterpriseSKU},
|
||||
TrackReadOnlyFeature: {TrackProfessionalSKU, TrackEnterpriseSKU},
|
||||
TrackSharedChannelsFeature: {TrackProfessionalSKU, TrackEnterpriseSKU},
|
||||
}
|
||||
|
||||
func New(srv ServerIface, dbStore store.Store, searchEngine *searchengine.Broker, log *mlog.Logger, verbose bool) (*TelemetryService, error) {
|
||||
|
||||
Ссылка в новой задаче
Block a user