// NewExporter creates an exporter for use.
NewExporter creates an exporter for use.
// NewExporter creates an exporter for use .
func NewExporter(log Log, host string, batchSize int, sendInterval, sendTimeout time.Duration) (*Exporter, error) {
	if log == nil {
		return nil, ErrLoggerNotProvided
	}
	if host == "" {
		return nil, ErrHostNotProvided
	}
	tr := http.Transport{
		Proxy: http.ProxyFromEnvironment,
		DialContext: (&net.Dialer{
			Timeout:   30 * time.Second,
			KeepAlive: 30 * time.Second,
			DualStack: true,
		}).DialContext,
		MaxIdleConns:          2,
		IdleConnTimeout:       90 * time.Second,
		TLSHandshakeTimeout:   10 * time.Second,
		ExpectContinueTimeout: 1 * time.Second,
	}
	e := Exporter{
		log:          log,
		host:         host,
		batchSize:    batchSize,
		sendInterval: sendInterval,
		sendTimeout:  sendTimeout,
		client: http.Client{
			Transport: &tr,
		},
		batch: make([]*trace.SpanData, 0, batchSize),
		timer: time.NewTimer(sendInterval),
	}
	return &e, nil
}
func NewExporter ( log Log , host string , batchSize int , sendInterval , sendTimeout time . Duration ) ( * Exporter , error ) { if log == nil { return nil , ErrLoggerNotProvided } if host == " " { return nil , ErrHostNotProvided } tr := http . Transport { Proxy : http . ProxyFromEnvironment , DialContext : ( & net . Dialer { Timeout : 30 * time . Second , KeepAlive : 30 * time . Second , DualStack : true , } ) . DialContext , MaxIdleConns : 2 , IdleConnTimeout : 90 * time . Second , TLSHandshakeTimeout : 10 * time . Second , ExpectContinueTimeout : 1 * time . Second , } e := Exporter { log : log , host : host , batchSize : batchSize , sendInterval : sendInterval , sendTimeout : sendTimeout , client : http . Client { Transport : & tr , } , batch : make ( [ ] * trace . SpanData , 0 , batchSize ) , timer : time . NewTimer ( sendInterval ) , } return & e , nil }
NewExporter creates an exporter for use.
NewExporter creates an exporter for use .