chore: ignore db spans in workspace watch endpoint (#4250)

This commit is contained in:
Colin Adler
2022-09-28 16:17:24 -05:00
committed by GitHub
parent 0c75ea6286
commit 574635f43d

View File

@ -15,6 +15,7 @@ import (
"github.com/go-chi/chi/v5"
"github.com/google/uuid"
"go.opentelemetry.io/otel/trace"
"golang.org/x/xerrors"
"cdr.dev/slog"
@ -26,6 +27,7 @@ import (
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/coderd/rbac"
"github.com/coder/coder/coderd/telemetry"
"github.com/coder/coder/coderd/tracing"
"github.com/coder/coder/coderd/util/ptr"
"github.com/coder/coder/codersdk"
)
@ -798,6 +800,9 @@ func (api *API) watchWorkspace(rw http.ResponseWriter, r *http.Request) {
return
}
// Ignore all trace spans after this, they're not too useful.
ctx = trace.ContextWithSpan(ctx, tracing.NoopSpan)
t := time.NewTicker(time.Second * 1)
defer t.Stop()
for {