From 362a2ebfc60c517e7f3e14079e3105fd5e918601 Mon Sep 17 00:00:00 2001 From: Rueian Date: Thu, 24 Jan 2019 15:30:31 +0800 Subject: [PATCH] Use opencensus's DefaultSampler instead of setting AlwaysSampler as defult in HTTPServerTrace and GRPCServerTrace --- tracing/opencensus/grpc.go | 8 -------- tracing/opencensus/http.go | 8 -------- 2 files changed, 16 deletions(-) diff --git a/tracing/opencensus/grpc.go b/tracing/opencensus/grpc.go index c0a36c4de..f244d9b4f 100644 --- a/tracing/opencensus/grpc.go +++ b/tracing/opencensus/grpc.go @@ -22,10 +22,6 @@ func GRPCClientTrace(options ...TracerOption) kitgrpc.ClientOption { option(&cfg) } - if cfg.Sampler == nil { - cfg.Sampler = trace.AlwaysSample() - } - clientBefore := kitgrpc.ClientBefore( func(ctx context.Context, md *metadata.MD) context.Context { var name string @@ -79,10 +75,6 @@ func GRPCServerTrace(options ...TracerOption) kitgrpc.ServerOption { option(&cfg) } - if cfg.Sampler == nil { - cfg.Sampler = trace.AlwaysSample() - } - serverBefore := kitgrpc.ServerBefore( func(ctx context.Context, md metadata.MD) context.Context { var name string diff --git a/tracing/opencensus/http.go b/tracing/opencensus/http.go index dd2cdf88e..ed6fbbf03 100644 --- a/tracing/opencensus/http.go +++ b/tracing/opencensus/http.go @@ -19,10 +19,6 @@ func HTTPClientTrace(options ...TracerOption) kithttp.ClientOption { option(&cfg) } - if cfg.Sampler == nil { - cfg.Sampler = trace.AlwaysSample() - } - if !cfg.Public && cfg.HTTPPropagate == nil { cfg.HTTPPropagate = &b3.HTTPFormat{} } @@ -101,10 +97,6 @@ func HTTPServerTrace(options ...TracerOption) kithttp.ServerOption { option(&cfg) } - if cfg.Sampler == nil { - cfg.Sampler = trace.AlwaysSample() - } - if !cfg.Public && cfg.HTTPPropagate == nil { cfg.HTTPPropagate = &b3.HTTPFormat{} }