Skip to content

Commit 2066696

Browse files
committed
trace: clarify how gRPC options work
Change-Id: Iafca1d6643a8a6b81b6b7b1035e9ef7f4413768f Reviewed-on: https://code-review.googlesource.com/11310 Reviewed-by: kokoro <[email protected]> Reviewed-by: Hana Kim <[email protected]>
1 parent 8ccb9da commit 2066696

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

trace/trace.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,16 @@ func requestHook(ctx context.Context, req *http.Request) func(resp *http.Respons
230230
}
231231
}
232232

233-
// EnableGRPCTracingDialOption enables tracing of requests that are sent over a
234-
// gRPC connection.
233+
// EnableGRPCTracingDialOption traces all outgoing requests from a gRPC client.
234+
// The calling context should already have a *trace.Span; a child span will be
235+
// created for the outgoing gRPC call. If the calling context doesn't have a span,
236+
// the call will not be traced.
237+
//
235238
// The functionality in gRPC that this relies on is currently experimental.
236239
var EnableGRPCTracingDialOption grpc.DialOption = grpc.WithUnaryInterceptor(grpc.UnaryClientInterceptor(grpcUnaryInterceptor))
237240

238-
// EnableGRPCTracing enables tracing of requests for clients that use gRPC
239-
// connections.
241+
// EnableGRPCTracing automatically traces all gRPC calls from cloud.google.com/go clients.
242+
//
240243
// The functionality in gRPC that this relies on is currently experimental.
241244
var EnableGRPCTracing option.ClientOption = option.WithGRPCDialOption(EnableGRPCTracingDialOption)
242245

0 commit comments

Comments
 (0)