* Ensure your own posts are never ACKed

* Don't ACK mobile websocket notifications

* Add counter for the unsupported Desktop Apps

* Count only push messages when checking for acks

* Fix generated

* Add tests, fix comment

* Fix help string

* Check for nil session
Этот коммит содержится в:
Devin Binnie
2024-04-23 17:31:17 -04:00
коммит произвёл GitHub
родитель 29fbcdfc2a
Коммит 9cf5a4bccb
9 изменённых файлов: 72 добавлений и 15 удалений

Просмотреть файл

@@ -203,11 +203,12 @@ type MetricsInterfaceImpl struct {
JobsActive *prometheus.GaugeVec
NotificationTotalCounters *prometheus.CounterVec
NotificationAckCounters *prometheus.CounterVec
NotificationSuccessCounters *prometheus.CounterVec
NotificationErrorCounters *prometheus.CounterVec
NotificationNotSentCounters *prometheus.CounterVec
NotificationTotalCounters *prometheus.CounterVec
NotificationAckCounters *prometheus.CounterVec
NotificationSuccessCounters *prometheus.CounterVec
NotificationErrorCounters *prometheus.CounterVec
NotificationNotSentCounters *prometheus.CounterVec
NotificationUnsupportedCounters *prometheus.CounterVec
}
func init() {
@@ -1109,6 +1110,18 @@ func New(ps *platform.PlatformService, driver, dataSource string) *MetricsInterf
)
m.Registry.MustRegister(m.NotificationNotSentCounters)
m.NotificationUnsupportedCounters = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: MetricsNamespace,
Subsystem: MetricsSubsystemNotifications,
Name: "unsupported",
Help: "Total number of untrackable notifications due to an unsupported app version",
ConstLabels: additionalLabels,
},
[]string{"type", "reason"},
)
m.Registry.MustRegister(m.NotificationUnsupportedCounters)
return m
}
@@ -1555,6 +1568,10 @@ func (mi *MetricsInterfaceImpl) IncrementNotificationNotSentCounter(notification
mi.NotificationNotSentCounters.With(prometheus.Labels{"type": string(notificationType), "reason": string(notSentReason)}).Inc()
}
func (mi *MetricsInterfaceImpl) IncrementNotificationUnsupportedCounter(notificationType model.NotificationType, notSentReason model.NotificationReason) {
mi.NotificationUnsupportedCounters.With(prometheus.Labels{"type": string(notificationType), "reason": string(notSentReason)}).Inc()
}
func (mi *MetricsInterfaceImpl) IncrementHTTPWebSockets(originClient string) {
mi.HTTPWebsocketsGauge.With(prometheus.Labels{"origin_client": originClient}).Inc()
}