Skip to content

Commit

Permalink
contrib: clarify use of UnaryInterceptor in grpc example (#1601)
Browse files Browse the repository at this point in the history
  • Loading branch information
katiehockman committed Dec 1, 2022
1 parent a35a123 commit aaf7d39
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion contrib/google.golang.org/grpc/example_test.go
Expand Up @@ -19,7 +19,9 @@ func Example_client() {
si := grpctrace.StreamClientInterceptor(grpctrace.WithServiceName("my-grpc-client"))
ui := grpctrace.UnaryClientInterceptor(grpctrace.WithServiceName("my-grpc-client"))

// Dial in using the created interceptor...
// Dial in using the created interceptor.
// Note: To use multiple UnaryInterceptors with grpc.Dial, you must use
// grpc.WithChainUnaryInterceptor instead (as of google.golang.org/grpc v1.51.0).
conn, err := grpc.Dial("localhost:50051", grpc.WithInsecure(),
grpc.WithStreamInterceptor(si), grpc.WithUnaryInterceptor(ui))
if err != nil {
Expand Down

0 comments on commit aaf7d39

Please sign in to comment.