in metricpublisher/publisher_handler.py [0:0]
def convert_batch_to_event(batch):
"""Convert a batch of metrics into a log event.
Parameters:
batch (list): The batch of metrics to convert
Returns:
event (dict): The event ready to be put
to a new log stream
"""
request_id = '_'.join(("log_events_retry", str(uuid.uuid4())))
return {
"request_id": request_id,
"metric_data": [unformat_metric(metric) for metric in batch]
}