gitlab.com/gitlab-org/labkit@v1.21.0/tracing/impl/lightstep_sampling.go (about) 1 //go:build tracer_static && tracer_static_lightstep 2 // +build tracer_static,tracer_static_lightstep 3 4 package impl 5 6 import ( 7 "github.com/lightstep/lightstep-tracer-go" 8 "github.com/opentracing/opentracing-go" 9 ) 10 11 func init() { 12 is := IsSampled 13 IsSampled = func(span opentracing.Span) bool { 14 spanContext := span.Context() 15 16 if lightstepContext, ok := spanContext.(lightstep.SpanContext); ok { 17 return lightstepContext.Sampled == "true" 18 } 19 return is(span) 20 } 21 }