From 077b0880d0ad87ed93e6f7b8e752cc6741ea9091 Mon Sep 17 00:00:00 2001 From: Katie Hockman Date: Thu, 1 Dec 2022 10:34:15 -0500 Subject: [PATCH 1/3] add clarification of UnaryInterceptor in grpc example --- contrib/google.golang.org/grpc/example_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/google.golang.org/grpc/example_test.go b/contrib/google.golang.org/grpc/example_test.go index 4dec22e5db..022d02f755 100644 --- a/contrib/google.golang.org/grpc/example_test.go +++ b/contrib/google.golang.org/grpc/example_test.go @@ -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: grpc.Dial does not support multiple UnaryInterceptor options directly. + // If this is needed, use grpc.WithChainUnaryInterceptor instead. conn, err := grpc.Dial("localhost:50051", grpc.WithInsecure(), grpc.WithStreamInterceptor(si), grpc.WithUnaryInterceptor(ui)) if err != nil { From 48c24b98b7f97d64f8ef6f80011e591a6b7c1cd9 Mon Sep 17 00:00:00 2001 From: Katie Hockman Date: Thu, 1 Dec 2022 10:40:57 -0500 Subject: [PATCH 2/3] Update contrib/google.golang.org/grpc/example_test.go Co-authored-by: Kyle Nusbaum --- contrib/google.golang.org/grpc/example_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/google.golang.org/grpc/example_test.go b/contrib/google.golang.org/grpc/example_test.go index 022d02f755..7ff0c2c7d1 100644 --- a/contrib/google.golang.org/grpc/example_test.go +++ b/contrib/google.golang.org/grpc/example_test.go @@ -20,8 +20,8 @@ func Example_client() { ui := grpctrace.UnaryClientInterceptor(grpctrace.WithServiceName("my-grpc-client")) // Dial in using the created interceptor. - // Note: grpc.Dial does not support multiple UnaryInterceptor options directly. - // If this is needed, use grpc.WithChainUnaryInterceptor instead. + // Note: To use multiple UnaryInterceptors with grpc.Dial, you must use + // grpc.WithChainUnaryInterceptor instead. conn, err := grpc.Dial("localhost:50051", grpc.WithInsecure(), grpc.WithStreamInterceptor(si), grpc.WithUnaryInterceptor(ui)) if err != nil { From 0caac93464c1877900c060a1b37e7a760edbdba3 Mon Sep 17 00:00:00 2001 From: Katie Hockman Date: Thu, 1 Dec 2022 10:42:59 -0500 Subject: [PATCH 3/3] Update example_test.go --- contrib/google.golang.org/grpc/example_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/google.golang.org/grpc/example_test.go b/contrib/google.golang.org/grpc/example_test.go index 7ff0c2c7d1..e8c7860ad0 100644 --- a/contrib/google.golang.org/grpc/example_test.go +++ b/contrib/google.golang.org/grpc/example_test.go @@ -21,7 +21,7 @@ func Example_client() { // Dial in using the created interceptor. // Note: To use multiple UnaryInterceptors with grpc.Dial, you must use - // grpc.WithChainUnaryInterceptor instead. + // 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 {