[MM-57010] Include client type in websocket connections metric (#26763)
* Include client type in websocket connections metric * Unexport field
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
effb99301e
Коммит
4b508eed46
@@ -67,6 +67,7 @@ type WebConnConfig struct {
|
||||
ConnectionID string
|
||||
Active bool
|
||||
ReuseCount int
|
||||
OriginClient string
|
||||
|
||||
// These aren't necessary to be exported to api layer.
|
||||
sequence int
|
||||
@@ -115,6 +116,9 @@ type WebConn struct {
|
||||
session atomic.Pointer[model.Session]
|
||||
connectionID atomic.Value
|
||||
|
||||
// The client type behind the connection (i.e. web, desktop or mobile)
|
||||
originClient string
|
||||
|
||||
activeChannelID atomic.Value
|
||||
activeTeamID atomic.Value
|
||||
activeRHSThreadChannelID atomic.Value
|
||||
@@ -236,6 +240,7 @@ func (ps *PlatformService) NewWebConn(cfg *WebConnConfig, suite SuiteIFace, runn
|
||||
pluginPosted: make(chan pluginWSPostedHook, 10),
|
||||
lastLogTimeSlow: time.Now(),
|
||||
lastLogTimeFull: time.Now(),
|
||||
originClient: cfg.OriginClient,
|
||||
}
|
||||
wc.active.Store(cfg.Active)
|
||||
|
||||
@@ -954,11 +959,13 @@ func (wc *WebConn) logSocketErr(source string, err error) {
|
||||
if websocket.IsCloseError(err, websocket.CloseNormalClosure, websocket.CloseNoStatusReceived) {
|
||||
mlog.Debug(source+": client side closed socket",
|
||||
mlog.String("user_id", wc.UserId),
|
||||
mlog.String("conn_id", wc.GetConnectionID()))
|
||||
mlog.String("conn_id", wc.GetConnectionID()),
|
||||
mlog.String("origin_client", wc.originClient))
|
||||
} else {
|
||||
mlog.Debug(source+": closing websocket",
|
||||
mlog.String("user_id", wc.UserId),
|
||||
mlog.String("conn_id", wc.GetConnectionID()),
|
||||
mlog.String("origin_client", wc.originClient),
|
||||
mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user