// InitJaeger todo close the connection
// InitJaeger is responsible for initialising the jaeger tracing instance.
InitJaeger todo close the connection
InitJaeger is responsible for initialising the jaeger tracing instance.
// InitJaeger todo close the connection // InitJaeger is responsible for initialising the jaeger tracing instance .
func InitJaeger(config *config.Config) (io.Closer, opentracing.Tracer) {
	logSpan, _ := strconv.ParseBool(config.Jaeger.LogSpans)
	jaegerCfgInstance := jaegerconfig.Configuration{
		ServiceName: config.Jaeger.ServiceName,
		Sampler: &jaegerconfig.SamplerConfig{
			Type:  jaeger.SamplerTypeConst,
			Param: 1,
		},
		Reporter: &jaegerconfig.ReporterConfig{
			LogSpans: logSpan,
			LocalAgentHostPort: config.Jaeger.Host + ":" + config.Jaeger.Port,
		},
	}
	tracer, closer, err := jaegerCfgInstance.NewTracer(
		jaegerconfig.Logger(jaegerlog.StdLogger),
		jaegerconfig.Metrics(metrics.NullFactory),
	)
	if err != nil {
		logger.Log.Fatal("cannot create tracer", zap.Error(err))
		panic(err)
	}
	logger.Log.Info("Jaeger tracer initiated")
	opentracing.SetGlobalTracer(tracer)
	return closer, tracer
}
func InitJaeger ( config * config . Config ) ( io . Closer , opentracing . Tracer ) { logSpan , _ := strconv . ParseBool ( config . Jaeger . LogSpans ) jaegerCfgInstance := jaegerconfig . Configuration { ServiceName : config . Jaeger . ServiceName , Sampler : & jaegerconfig . SamplerConfig { Type : jaeger . SamplerTypeConst , Param : 1 , } , Reporter : & jaegerconfig . ReporterConfig { LogSpans : logSpan , LocalAgentHostPort : config . Jaeger . Host + " " + config . Jaeger . Port , } , } tracer , closer , err := jaegerCfgInstance . NewTracer ( jaegerconfig . Logger ( jaegerlog . StdLogger ) , jaegerconfig . Metrics ( metrics . NullFactory ) , ) if err != nil { logger . Log . Fatal ( " " , zap . Error ( err ) ) panic ( err ) } logger . Log . Info ( " " ) opentracing . SetGlobalTracer ( tracer ) return closer , tracer }
InitJaeger todo close the connection
InitJaeger is responsible for initialising the jaeger tracing instance.
InitJaeger todo close the connection InitJaeger is responsible for initialising the jaeger tracing instance .
//conversion string val to bool //Jaeger configuration setup //Service name is the name of project for which tracing will be present // SamplerTypeConst is the type of sampler that always makes the same decision. //Reporter configuration //Local Agent Host port //New Tracer instance //global tracer setup , opentracing