Skip to content

Commit

Permalink
Merge pull request #830 from rueian/use-opencensus-default-sampler
Browse files Browse the repository at this point in the history
Use opencensus's DefaultSampler instead of AlwaysSampler as default
  • Loading branch information
basvanbeek authored Jan 25, 2019
2 parents 8a8a1bb + 362a2eb commit 6b19129
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
8 changes: 0 additions & 8 deletions tracing/opencensus/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions tracing/opencensus/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
}
Expand Down Expand Up @@ -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{}
}
Expand Down

0 comments on commit 6b19129

Please sign in to comment.