File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,30 @@ For convenience `NewClient` is provided which returns a HTTP Client which embeds
5555calling the ` DoWithAppSpan() ` method.
5656
5757#### grpc
58- gRPC middleware / interceptors are planned for the near future.
58+ Easy to use stats.Handler middleware are provided for tracing gRPC server and
59+ client requests.
60+
61+ For a server, pass ` NewServerHandler ` when calling ` NewServer ` , e.g.,
62+
63+ ``` go
64+ import (
65+ " google.golang.org/grpc"
66+ zipkingrpc " github.com/openzipkin/zipkin-go/middleware/grpc"
67+ )
68+
69+ server = grpc.NewServer (grpc.StatsHandler (zipkingrpc.NewServerHandler (tracer)))
70+ ```
71+
72+ For a client, pass ` NewClientHandler ` when calling ` Dial ` , e.g.,
73+
74+ ``` go
75+ import (
76+ " google.golang.org/grpc"
77+ zipkingrpc " github.com/openzipkin/zipkin-go/middleware/grpc"
78+ )
79+
80+ conn, err = grpc.Dial (addr, grpc.WithStatsHandler (zipkingrpc.NewClientHandler (tracer)))
81+ ```
5982
6083### reporter
6184The reporter package holds the interface which the various Reporter
You can’t perform that action at this time.
0 commit comments