func InitTracer(cfg Config) error {
	if !cfg.Enabled {
		return nil
	}
	tags := make([]opentracing.Tag, 0)
	for k, v := range cfg.Tags {
		tags = append(tags, opentracing.Tag{Key: k, Value: v})
	}
	options := jaegerconfig.Configuration{
		ServiceName: cfg.ServiceName,
		Reporter: &jaegerconfig.ReporterConfig{
			LocalAgentHostPort: cfg.AgentAddress,
		},
		Sampler: &jaegerconfig.SamplerConfig{
			Type:  cfg.SamplerType,
			Param: cfg.SamplerParam,
		},
		Tags: tags,
	}
	tracer, c, err := options.NewTracer()
	if err != nil {
		return err
	}
	opentracing.SetGlobalTracer(tracer)
	closer = c
	return nil
}
InitTracer creates a new Jaeger tracer, and sets it as global tracer.
package tracer
import (
	"io"
	"github.com/opentracing/opentracing-go"
	jaegerconfig "github.com/uber/jaeger-client-go/config"
)
type Config struct {
	Enabled bool
	ServiceName string
	AgentAddress string
	SamplerType string
	SamplerParam float64
	Tags map[string]string
}
type noopCloser struct{}
func (*noopCloser) Close() error { return nil }
var closer io.Closer = &noopCloser{}