DialOption returns a dial option which enables OpenCensus instrumentation code for a grpc.ClientConn. Client applications interested in instrumenting their grpc.ClientConn should pass the dial option returned from this function as the first dial option to grpc.Dial(). Using this option will always
(to TraceOptions)
| 62 | // conjunction, and do not work standalone. It is not supported to use this |
| 63 | // alongside another stats handler dial option. |
| 64 | func DialOption(to TraceOptions) grpc.DialOption { |
| 65 | csh := &clientStatsHandler{to: to} |
| 66 | return joinDialOptions(grpc.WithChainUnaryInterceptor(csh.unaryInterceptor), grpc.WithChainStreamInterceptor(csh.streamInterceptor), grpc.WithStatsHandler(csh)) |
| 67 | } |
| 68 | |
| 69 | // ServerOption returns a server option which enables OpenCensus instrumentation |
| 70 | // code for a grpc.Server. |