code: func (tracer *tracerImpl) Close(ctx context.Context) {
  	tracer.closeOnce.Do(func() {
  		// notify report loop that we are closing
  		close(tracer.closeReportLoopChannel)
  		select {
  		case <-tracer.reportLoopClosedChannel:
  			tracer.Flush(ctx)
  		case <-ctx.Done():
  			return
  		}
  
  		// now its safe to close the connection
  		tracer.lock.Lock()
  		conn := tracer.connection
  		tracer.connection = nil
  		tracer.lock.Unlock()
  
  		if conn != nil {
  			err := conn.Close()
  			if err != nil {
  				emitEvent(newEventConnectionError(err))
  			}
  		}
  	})
  }
docs: // Close flushes and then terminates the LightStep collector. Close may only be
  // called once; subsequent calls to Close are no-ops.