def METHOD_NAME(payload):
    """
    The function retrieves from the payload the latest version of
    each metric. It is required since the payload probably can
    contain buffered metrics. But Machine Agent HTTP listener payload
    doesn't support any timestamps.
    """
    last_metrics = {}
    for metric in payload:
        metric_name = metric["metricName"]
        last_metric = last_metrics.get(metric_name)
        if last_metric:
            if metric["timestamp"] > last_metric["timestamp"]:
                last_metrics[metric_name] = metric
        else:
            last_metrics[metric_name] = metric
    filtered_metrics = []
    for metric in last_metrics.values():
        del metric["timestamp"]
        filtered_metrics.append(metric)
    return filtered_metrics