Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 574635f

Browse files
authored
chore: ignore db spans in workspace watch endpoint (#4250)
1 parent 0c75ea6 commit 574635f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

coderd/workspaces.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515

1616
"github.com/go-chi/chi/v5"
1717
"github.com/google/uuid"
18+
"go.opentelemetry.io/otel/trace"
1819
"golang.org/x/xerrors"
1920

2021
"cdr.dev/slog"
@@ -26,6 +27,7 @@ import (
2627
"github.com/coder/coder/coderd/httpmw"
2728
"github.com/coder/coder/coderd/rbac"
2829
"github.com/coder/coder/coderd/telemetry"
30+
"github.com/coder/coder/coderd/tracing"
2931
"github.com/coder/coder/coderd/util/ptr"
3032
"github.com/coder/coder/codersdk"
3133
)
@@ -798,6 +800,9 @@ func (api *API) watchWorkspace(rw http.ResponseWriter, r *http.Request) {
798800
return
799801
}
800802

803+
// Ignore all trace spans after this, they're not too useful.
804+
ctx = trace.ContextWithSpan(ctx, tracing.NoopSpan)
805+
801806
t := time.NewTicker(time.Second * 1)
802807
defer t.Stop()
803808
for {

0 commit comments

Comments
 (0)