code: func (sink *RiemannSink) ExportData(dataBatch *core.DataBatch) {
  	sink.Lock()
  	defer sink.Unlock()
  
  	if sink.client == nil {
  		// the client could be nil here, so we reconnect
  		client, err := riemannCommon.GetRiemannClient(sink.config)
  		if err != nil {
  			glog.Warningf("Riemann sink not connected: %v", err)
  			return
  		}
  		sink.client = client
  	}
  
  	var events []riemanngo.Event
  
  	for _, metricSet := range dataBatch.MetricSets {
  		host := metricSet.Labels[core.LabelHostname.Key]
  		for metricName, metricValue := range metricSet.MetricValues {
  			if value := metricValue.GetValue(); value != nil {
  				timestamp := dataBatch.Timestamp.Unix()
  				// creates an event and add it to dataEvent
  				events = appendEvent(events, sink, host, metricName, value, metricSet.Labels, timestamp)
  			}
  		}
  		for _, metric := range metricSet.LabeledMetrics {
  			if value := metric.GetValue(); value != nil {
  				labels := make(map[string]string)
  				for k, v := range metricSet.Labels {
  					labels[k] = v
  				}
  				for k, v := range metric.Labels {
  					labels[k] = v
  				}
  				timestamp := dataBatch.Timestamp.Unix()
  				// creates an event and add it to dataEvent
  				events = appendEvent(events, sink, host, metric.Name, value, labels, timestamp)
  			}
  		}
  	}
  	// Send events to Riemann if events is not empty
  	if len(events) > 0 {
  		err := riemannCommon.SendData(sink.client, events)
  		if err != nil {
  			glog.Warningf("Error sending events to Riemann: %v", err)
  			// client will reconnect later
  			sink.client = nil
  		}
  	}
  }
docs: // ExportData Send a collection of Timeseries to Riemann