Skip to content

Commit

Permalink
Remove redundant op name middleware.
Browse files Browse the repository at this point in the history
The weaveworks/common already has the middleware on by default.
See: https://github.com/weaveworks/common/blob/master/server/server.go#L162-L164
and weaveworks/common#126

Signed-off-by: Goutham Veeramachaneni <[email protected]>
  • Loading branch information
gouthamve committed Jun 11, 2019
1 parent 5d867bc commit 9c376de
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions pkg/cortex/cortex.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 9c376de

Please sign in to comment.