[MM-58159] Add admin setting for notification monitoring alongside feature flag (#26979)
* [MM-58159] Add admin setting for notification monitoring alongside feature flag * Use helper function
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
f111db5fe8
Коммит
d6a8ad0d55
@@ -1736,11 +1736,7 @@ func ShouldAckWebsocketNotification(channelType model.ChannelType, userNotificat
|
||||
}
|
||||
|
||||
func (a *App) CountNotification(notificationType model.NotificationType) {
|
||||
if a.Metrics() == nil {
|
||||
return
|
||||
}
|
||||
|
||||
if !a.Config().FeatureFlags.NotificationMonitoring {
|
||||
if a.notificationMetricsDisabled() {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1748,11 +1744,7 @@ func (a *App) CountNotification(notificationType model.NotificationType) {
|
||||
}
|
||||
|
||||
func (a *App) CountNotificationAck(notificationType model.NotificationType) {
|
||||
if a.Metrics() == nil {
|
||||
return
|
||||
}
|
||||
|
||||
if !a.Config().FeatureFlags.NotificationMonitoring {
|
||||
if a.notificationMetricsDisabled() {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1764,11 +1756,7 @@ func (a *App) CountNotificationReason(
|
||||
notificationType model.NotificationType,
|
||||
notificationReason model.NotificationReason,
|
||||
) {
|
||||
if a.Metrics() == nil {
|
||||
return
|
||||
}
|
||||
|
||||
if !a.Config().FeatureFlags.NotificationMonitoring {
|
||||
if a.notificationMetricsDisabled() {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1783,3 +1771,15 @@ func (a *App) CountNotificationReason(
|
||||
a.Metrics().IncrementNotificationUnsupportedCounter(notificationType, notificationReason)
|
||||
}
|
||||
}
|
||||
|
||||
func (a *App) notificationMetricsDisabled() bool {
|
||||
if a.Metrics() == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
if a.Config().FeatureFlags.NotificationMonitoring && *a.Config().MetricsSettings.EnableNotificationMetrics {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ func incrementWebsocketCounter(wc *platform.WebConn) {
|
||||
return
|
||||
}
|
||||
|
||||
if !wc.Platform.Config().FeatureFlags.NotificationMonitoring {
|
||||
if !(wc.Platform.Config().FeatureFlags.NotificationMonitoring && *wc.Platform.Config().MetricsSettings.EnableNotificationMetrics) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user