feat: log long-lived connections acceptance (#17219)

Closes #16904
This commit is contained in:
Michael Suchacz
2025-04-08 10:30:05 +02:00
committed by GitHub
parent abe3ad68f5
commit ce22de8d15
9 changed files with 351 additions and 24 deletions

View File

@ -219,6 +219,9 @@ func (api *API) watchInboxNotifications(rw http.ResponseWriter, r *http.Request)
encoder := wsjson.NewEncoder[codersdk.GetInboxNotificationResponse](conn, websocket.MessageText)
defer encoder.Close(websocket.StatusNormalClosure)
// Log the request immediately instead of after it completes.
httpmw.RequestLoggerFromContext(ctx).WriteLog(ctx, http.StatusAccepted)
for {
select {
case <-ctx.Done():