[VOL-3199] Added support for dynamic enable/disable of Trace Publishing in running components
Change-Id: Idc1b21ddb6b80f46ffdc45be6b44c1e5d8de0c8f
diff --git a/pkg/grpc/server.go b/pkg/grpc/server.go
index 9f7c785..f5f9550 100644
--- a/pkg/grpc/server.go
+++ b/pkg/grpc/server.go
@@ -19,7 +19,7 @@
"context"
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
grpc_opentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing"
- "github.com/opentracing/opentracing-go"
+ "github.com/opencord/voltha-lib-go/v3/pkg/log"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
@@ -102,10 +102,10 @@
// Use Intercepters to automatically inject and publish Open Tracing Spans by this GRPC server
serverOptions := []grpc.ServerOption{
grpc.StreamInterceptor(grpc_middleware.ChainStreamServer(
- grpc_opentracing.StreamServerInterceptor(grpc_opentracing.WithTracer(opentracing.GlobalTracer())),
+ grpc_opentracing.StreamServerInterceptor(grpc_opentracing.WithTracer(log.ActiveTracerProxy{})),
)),
grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(
- grpc_opentracing.UnaryServerInterceptor(grpc_opentracing.WithTracer(opentracing.GlobalTracer())),
+ grpc_opentracing.UnaryServerInterceptor(grpc_opentracing.WithTracer(log.ActiveTracerProxy{})),
mkServerInterceptor(s),
))}