From 9c376de07c730d471dc17762c5afbadef2f98b8a Mon Sep 17 00:00:00 2001 From: Goutham Veeramachaneni Date: Tue, 11 Jun 2019 16:40:31 +0530 Subject: [PATCH] Remove redundant op name middleware. The weaveworks/common already has the middleware on by default. See: https://github.com/weaveworks/common/blob/master/server/server.go#L162-L164 and https://github.com/weaveworks/common/pull/126 Signed-off-by: Goutham Veeramachaneni --- pkg/cortex/cortex.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/pkg/cortex/cortex.go b/pkg/cortex/cortex.go index 53ac96c394..c2901ee22b 100644 --- a/pkg/cortex/cortex.go +++ b/pkg/cortex/cortex.go @@ -3,12 +3,9 @@ package cortex import ( "flag" "fmt" - "net/http" "os" "github.com/go-kit/kit/log/level" - "github.com/opentracing-contrib/go-stdlib/nethttp" - "github.com/opentracing/opentracing-go" "github.com/pkg/errors" "github.com/weaveworks/common/middleware" "github.com/weaveworks/common/server" @@ -143,15 +140,6 @@ func New(cfg Config) (*Cortex, error) { target: cfg.Target, } - operationNameFunc := nethttp.OperationNameFunc(func(r *http.Request) string { - return r.URL.RequestURI() - }) - cfg.Server.HTTPMiddleware = []middleware.Interface{ - middleware.Func(func(handler http.Handler) http.Handler { - return nethttp.Middleware(opentracing.GlobalTracer(), handler, operationNameFunc) - }), - } - cortex.setupAuthMiddleware(&cfg) if err := cortex.init(&cfg, cfg.Target); err != nil {