...

Source file src/github.com/linkerd/linkerd2/pkg/trace/trace.go

Documentation: github.com/linkerd/linkerd2/pkg/trace

     1  package trace
     2  
     3  import (
     4  	"contrib.go.opencensus.io/exporter/ocagent"
     5  	"go.opencensus.io/trace"
     6  )
     7  
     8  // InitializeTracing initiates trace, exporter and the sampler
     9  func InitializeTracing(serviceName string, address string) error {
    10  	oce, err := ocagent.NewExporter(
    11  		ocagent.WithInsecure(),
    12  		ocagent.WithAddress(address),
    13  		ocagent.WithServiceName(serviceName))
    14  	if err != nil {
    15  		return err
    16  	}
    17  	trace.RegisterExporter(oce)
    18  	trace.ApplyConfig(trace.Config{
    19  		DefaultSampler: trace.AlwaysSample(),
    20  	})
    21  	return nil
    22  }
    23  

View as plain text