flatten metrics data