code: func (tracer *tracerImpl) postFlush(flushEventError *eventFlushError) *eventStatusReport {
  	tracer.lock.Lock()
  	defer tracer.lock.Unlock()
  
  	tracer.reportInFlight = false
  
  	statusReportEvent := newEventStatusReport(
  		tracer.flushing.reportStart,
  		tracer.flushing.reportEnd,
  		len(tracer.flushing.rawSpans),
  		int(tracer.flushing.droppedSpanCount+tracer.buffer.droppedSpanCount),
  		int(tracer.flushing.logEncoderErrorCount+tracer.buffer.logEncoderErrorCount),
  	)
  
  	if flushEventError == nil {
  		tracer.flushing.clear()
  		return statusReportEvent
  	}
  
  	switch flushEventError.State() {
  	case FlushErrorTranslate:
  		// When there's a translation error, we do not want to retry.
  		tracer.flushing.clear()
  	default:
  		// Restore the records that did not get sent correctly
  		tracer.buffer.mergeFrom(&tracer.flushing)
  	}
  
  	statusReportEvent.SetSentSpans(0)
  
  	return statusReportEvent
  }
docs: // postFlush handles lock-protected data manipulation after flushing