write traces as a csv