diff --git a/go.mod b/go.mod index 959b05301..67ccd523f 100644 --- a/go.mod +++ b/go.mod @@ -115,7 +115,6 @@ require ( github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/uuid v1.3.0 // indirect github.com/gorilla/css v1.0.0 // indirect - github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/websocket v1.4.2 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect diff --git a/internal/driver/daemon.go b/internal/driver/daemon.go index 6ac006156..49b64e8c6 100644 --- a/internal/driver/daemon.go +++ b/internal/driver/daemon.go @@ -35,6 +35,7 @@ import ( "github.com/ory/analytics-go/v4" "github.com/ory/x/healthx" "github.com/ory/x/metricsx" + "github.com/ory/x/otelx" "github.com/spf13/cobra" "github.com/ory/keto/internal/driver/config" @@ -128,7 +129,7 @@ func (r *RegistryDefault) serveRead(ctx context.Context, done chan<- struct{}) f rt, s := r.ReadRouter(ctx), r.ReadGRPCServer(ctx) if tracer := r.Tracer(ctx); tracer.IsLoaded() { - rt = x.TraceHandler(rt) + rt = otelx.TraceHandler(rt) } return func() error { @@ -140,7 +141,7 @@ func (r *RegistryDefault) serveWrite(ctx context.Context, done chan<- struct{}) rt, s := r.WriteRouter(ctx), r.WriteGRPCServer(ctx) if tracer := r.Tracer(ctx); tracer.IsLoaded() { - rt = x.TraceHandler(rt) + rt = otelx.TraceHandler(rt) } return func() error { diff --git a/internal/driver/registry_default.go b/internal/driver/registry_default.go index ee5f91c65..010ced836 100644 --- a/internal/driver/registry_default.go +++ b/internal/driver/registry_default.go @@ -114,10 +114,6 @@ func (r *RegistryDefault) Tracer(ctx context.Context) *otelx.Tracer { r.tracer = t } - if r.tracer.Tracer() == nil { - r.tracer = otelx.NewNoop(r.l, r.Config(ctx).TracingConfig()) - } - return r.tracer } diff --git a/internal/x/tracing.go b/internal/x/tracing.go deleted file mode 100644 index 7707a982b..000000000 --- a/internal/x/tracing.go +++ /dev/null @@ -1,14 +0,0 @@ -package x - -import ( - "net/http" - - "github.com/ory/x/otelx" -) - -// TraceHandler wraps otelx.NewHandler, passing the URL path as the span name. -func TraceHandler(h http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - otelx.NewHandler(h, r.URL.Path).ServeHTTP(w, r) - }) -}