@@ -60,7 +60,6 @@ type httpReporter struct {
6060 reqCallback RequestCallbackFn
6161 reqTimeout time.Duration
6262 serializer reporter.SpanSerializer
63- doNotSample bool
6463}
6564
6665// Send implements reporter
@@ -153,9 +152,12 @@ func (r *httpReporter) sendBatch() error {
153152 r .logger .Printf ("failed when creating the request: %s\n " , err .Error ())
154153 return err
155154 }
156- if r .doNotSample {
157- req .Header .Set ("b3" , "0" )
158- }
155+
156+ // By default we send b3:0 header to mitigate trace reporting amplification in
157+ // service mesh environments where the sidecar proxies might trace the call
158+ // we do here towards the Zipkin collector.
159+ req .Header .Set ("b3" , "0" )
160+
159161 req .Header .Set ("Content-Type" , r .serializer .ContentType ())
160162 if r .reqCallback != nil {
161163 r .reqCallback (req )
@@ -241,17 +243,6 @@ func Serializer(serializer reporter.SpanSerializer) ReporterOption {
241243 }
242244}
243245
244- // AllowSamplingReporterCalls if set to true will remove the b3:0 header on
245- // outgoing calls to the Zipkin collector.
246- // By default we send b3:0 header to mitigate trace reporting amplification in
247- // service mesh environments where the sidecar proxies might trace the call
248- // we do here towards the Zipkin collector.
249- func AllowSamplingReporterCalls (allow bool ) ReporterOption {
250- return func (r * httpReporter ) {
251- r .doNotSample = ! allow
252- }
253- }
254-
255246// NewReporter returns a new HTTP Reporter.
256247// url should be the endpoint to send the spans to, e.g.
257248// http://localhost:9411/api/v2/spans
@@ -271,7 +262,6 @@ func NewReporter(url string, opts ...ReporterOption) reporter.Reporter {
271262 batchMtx : & sync.Mutex {},
272263 serializer : reporter.JSONSerializer {},
273264 reqTimeout : defaultTimeout ,
274- doNotSample : true ,
275265 }
276266
277267 for _ , opt := range opts {
0 commit comments