[MM-57010] Include client type in websocket connections metric (#26763)

* Include client type in websocket connections metric

* Unexport field
Этот коммит содержится в:
Claudio Costa
2024-04-16 10:49:49 -06:00
коммит произвёл GitHub
родитель effb99301e
Коммит 4b508eed46
8 изменённых файлов: 51 добавлений и 11 удалений

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

@@ -391,6 +391,9 @@ func (h *Hub) Start() {
connIndex.Add(webConn)
atomic.StoreInt64(&h.connectionCount, int64(connIndex.AllActive()))
if metrics := h.platform.metricsIFace; metrics != nil {
metrics.IncrementHTTPWebSockets(webConn.originClient)
}
if webConn.IsAuthenticated() && webConn.reuseCount == 0 {
// The hello message should only be sent when the reuseCount is 0.
@@ -405,6 +408,9 @@ func (h *Hub) Start() {
webConn.active.Store(false)
atomic.StoreInt64(&h.connectionCount, int64(connIndex.AllActive()))
if metrics := h.platform.metricsIFace; metrics != nil {
metrics.DecrementHTTPWebSockets(webConn.originClient)
}
if webConn.UserId == "" {
continue