def shorten_trace_data_paths(trace_data):
    """
    Shorten the paths in trace_data to max 3 components
    :param trace_data:
    :return:
    """
    for i, (direction, _script, method, path, db) in enumerate(trace_data):
        path = '/'.join(path.rsplit('/')[-3:])
        trace_data[i] = direction, _script, method, path, db
    return trace_data
