refactoring tracing interceptors. (#1009)

* refactor tracing interceptors

* add stream tracing interceptor
This commit is contained in:
Kevin Wan
2021-09-07 17:58:22 +08:00
committed by GitHub
parent 96a35ecf1a
commit c837dc21bb
9 changed files with 160 additions and 12 deletions

View File

@@ -13,8 +13,8 @@ import (
"google.golang.org/grpc/status"
)
// OpenTracingInterceptor returns a grpc.UnaryClientInterceptor for opentelemetry.
func OpenTracingInterceptor() grpc.UnaryClientInterceptor {
// UnaryOpenTracingInterceptor returns a grpc.UnaryClientInterceptor for opentelemetry.
func UnaryOpenTracingInterceptor() grpc.UnaryClientInterceptor {
propagator := otel.GetTextMapPropagator()
return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn,
invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {