@@ -22,7 +22,6 @@ import (
22
22
"github.com/bep/debounce"
23
23
"github.com/go-chi/chi/v5"
24
24
"github.com/google/uuid"
25
- "go.opentelemetry.io/otel/trace"
26
25
"golang.org/x/exp/slices"
27
26
"golang.org/x/mod/semver"
28
27
"golang.org/x/xerrors"
@@ -36,7 +35,6 @@ import (
36
35
"github.com/coder/coder/coderd/httpapi"
37
36
"github.com/coder/coder/coderd/httpmw"
38
37
"github.com/coder/coder/coderd/rbac"
39
- "github.com/coder/coder/coderd/tracing"
40
38
"github.com/coder/coder/coderd/util/ptr"
41
39
"github.com/coder/coder/codersdk"
42
40
"github.com/coder/coder/codersdk/agentsdk"
@@ -859,7 +857,8 @@ func (api *API) workspaceAgentCoordinate(rw http.ResponseWriter, r *http.Request
859
857
}
860
858
disconnectedAt := workspaceAgent .DisconnectedAt
861
859
updateConnectionTimes := func (ctx context.Context ) error {
862
- err = api .Database .UpdateWorkspaceAgentConnectionByID (ctx , database.UpdateWorkspaceAgentConnectionByIDParams {
860
+ //nolint:gocritic // We only update ourself.
861
+ err = api .Database .UpdateWorkspaceAgentConnectionByID (dbauthz .AsSystemRestricted (ctx ), database.UpdateWorkspaceAgentConnectionByIDParams {
863
862
ID : workspaceAgent .ID ,
864
863
FirstConnectedAt : firstConnectedAt ,
865
864
LastConnectedAt : lastConnectedAt ,
@@ -920,11 +919,6 @@ func (api *API) workspaceAgentCoordinate(rw http.ResponseWriter, r *http.Request
920
919
}
921
920
api .publishWorkspaceUpdate (ctx , build .WorkspaceID )
922
921
923
- // End span so we don't get long lived trace data.
924
- tracing .EndHTTPSpan (r , http .StatusOK , trace .SpanFromContext (ctx ))
925
- // Ignore all trace spans after this.
926
- ctx = trace .ContextWithSpan (ctx , tracing .NoopSpan )
927
-
928
922
api .Logger .Info (ctx , "accepting agent" , slog .F ("agent" , workspaceAgent ))
929
923
930
924
defer conn .Close (websocket .StatusNormalClosure , "" )
@@ -1356,10 +1350,6 @@ func (api *API) watchWorkspaceAgentMetadata(rw http.ResponseWriter, r *http.Requ
1356
1350
<- senderClosed
1357
1351
}()
1358
1352
1359
- // We don't want this intentionally long request to skew our tracing
1360
- // reports.
1361
- ctx = trace .ContextWithSpan (ctx , tracing .NoopSpan )
1362
-
1363
1353
const refreshInterval = time .Second * 5
1364
1354
refreshTicker := time .NewTicker (refreshInterval )
1365
1355
defer refreshTicker .Stop ()
0 commit comments