swarm/api/http: remove opentracing

This commit is contained in:
Anton Evangelatov 2018-12-10 19:46:20 +01:00
parent 07b10926f5
commit 73364460cd

View file

@ -11,8 +11,7 @@ import (
"github.com/ethereum/go-ethereum/swarm/api" "github.com/ethereum/go-ethereum/swarm/api"
"github.com/ethereum/go-ethereum/swarm/log" "github.com/ethereum/go-ethereum/swarm/log"
"github.com/ethereum/go-ethereum/swarm/sctx" "github.com/ethereum/go-ethereum/swarm/sctx"
opentracing "github.com/opentracing/opentracing-go" "github.com/ethereum/go-ethereum/swarm/spancontext"
"github.com/opentracing/opentracing-go/ext"
"github.com/pborman/uuid" "github.com/pborman/uuid"
) )
@ -95,10 +94,7 @@ func InstrumentOpenTracing(h http.Handler) http.Handler {
return return
} }
spanName := fmt.Sprintf("http.%s.%s", r.Method, uri.Scheme) spanName := fmt.Sprintf("http.%s.%s", r.Method, uri.Scheme)
wireContext, _ := opentracing.GlobalTracer().Extract( ctx, sp := spancontext.StartSpan(r.Context(), spanName)
opentracing.HTTPHeaders,
opentracing.HTTPHeadersCarrier(r.Header))
sp, ctx := opentracing.StartSpanFromContext(r.Context(), spanName, ext.RPCServerOption(wireContext))
defer sp.Finish() defer sp.Finish()
h.ServeHTTP(w, r.WithContext(ctx)) h.ServeHTTP(w, r.WithContext(ctx))