Although PM2 does a pretty good job of keeping the server up and running, we need to monitor all unknown exceptions that occur or potential sources of memory leaks. PMX provides just the module for that. You can follow the example in chapter 9/pmx-utilities. Initialize pmx as usual. Just whenever there is an error, notify pmx with the notify method:
pmx.notify(new Error("Unexpected Exception"));
This is enough to send out an error to keymetrics to give it information about application exceptions. You will receive email notifications, too.
PMX monitors constant usage of the service, too, in order to detect memory leaks, if any. Check the route /memory-leak, for example.