The cloud.google.com/go/trace package will soon break three APIs:
1. traceGRPCServerInterceptor will be provided from *trace.Client.
var tc *trace.Client // initialize the client
Instead of
s := grpc.NewServer(grpc.UnaryInterceptor(trace.GRPCServerInterceptor(tc)))
write
s := grpc.NewServer(grpc.UnaryInterceptor(tc.GRPCServerInterceptor()))
2. trace.GRPCClientInterceptor will too provided from *trace.Client.
Instead of
conn, err := grpc.Dial(srv.Addr, grpc.WithUnaryInterceptor(trace.GRPCClientInterceptor()))
write
conn, err := grpc.Dial(srv.Addr, grpc.WithUnaryInterceptor(tc.GRPCClientInterceptor()))
3. We removed the deprecated trace.EnableGRPCTracing. Use the gRPC interceptor as a dial option as shown below when initializing Cloud package clients:
pubsubClient, err := pubsub.NewClient(ctx, "project-id", option.WithGRPCDialOption(grpc.WithUnaryInterceptor(tc.GRPCClientInterceptor())))
if err != nil {
log.Fatal(err)
}