MCPcopy
hub / github.com/grpc/grpc-go / DialOption

Function DialOption

stats/opencensus/opencensus.go:64–67  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

62// conjunction, and do not work standalone. It is not supported to use this
63// alongside another stats handler dial option.
64func 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.

Callers 5

startOpenCensusFunction · 0.92
exporting.goFile · 0.92
TestOpenCensusTagsMethod · 0.70
TestSpanMethod · 0.70

Calls 3

WithStatsHandlerFunction · 0.92

Tested by 3

TestOpenCensusTagsMethod · 0.56
TestSpanMethod · 0.56