Skip to content

Commit

Permalink
Use the op names from common/server
Browse files Browse the repository at this point in the history
We don't need to the tracing middleware again. Further, the op names are
not sanitised here.

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
  • Loading branch information
gouthamve committed Mar 15, 2019
1 parent 94cdfac commit f734878
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions pkg/loki/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"net/http"
"strings"

"github.com/opentracing-contrib/go-stdlib/nethttp"
opentracing "github.com/opentracing/opentracing-go"
"google.golang.org/grpc/health/grpc_health_v1"

"github.com/cortexproject/cortex/pkg/chunk/storage"
Expand Down Expand Up @@ -114,13 +112,7 @@ func (t *Loki) initDistributor() (err error) {
return
}

operationNameFunc := nethttp.OperationNameFunc(func(r *http.Request) string {
return r.URL.RequestURI()
})
t.server.HTTP.Handle("/api/prom/push", middleware.Merge(
middleware.Func(func(handler http.Handler) http.Handler {
return nethttp.Middleware(opentracing.GlobalTracer(), handler, operationNameFunc)
}),
t.httpAuthMiddleware,
).Wrap(http.HandlerFunc(t.distributor.PushHandler)))

Expand All @@ -133,13 +125,7 @@ func (t *Loki) initQuerier() (err error) {
return
}

operationNameFunc := nethttp.OperationNameFunc(func(r *http.Request) string {
return r.URL.RequestURI()
})
httpMiddleware := middleware.Merge(
middleware.Func(func(handler http.Handler) http.Handler {
return nethttp.Middleware(opentracing.GlobalTracer(), handler, operationNameFunc)
}),
t.httpAuthMiddleware,
)
t.server.HTTP.Handle("/api/prom/query", httpMiddleware.Wrap(http.HandlerFunc(t.querier.QueryHandler)))
Expand Down

0 comments on commit f734878

Please sign in to comment.