This adapter injects an OpenCensus span in the metadata of a gRPC call, which is extracted from your OpenTracing span before.
If your project uses OpenTracing and you call a service via gRPC, which uses OpenCensus, this adapter makes the span available in the remote service.
d, err := grpc.Dial("localhost:9080", grpc.WithInsecure(),
grpc.WithUnaryInterceptor(otocadapter.OpenCensusAdapterClientInterceptor(tracer)),
)
if err != nil {
logrus.Fatalln("Can't connect to DGraph:", err)
}
defer func() {
d.Close()
logrus.Info("Closed Dgraph connection...")
}()
dgraphClient := dgo.NewDgraphClient(api.NewDgraphClient(d))
go get -u github.com/gonicus/grpc-opentracing-opencensus-adapter