How to get the process id of an application running running on distributed environments

I am trying to collect the performance metrics like CPU usage and memory usage of an spark application.when I run the application on a node , I can get the process id using ps ef command and can collect its metrics on the node where it ran , but how can I get its performance metrics where the application is using other nodes as well for processing. I can't find any other process running with that name in other nodes.