I have been enjoying Arunoda Susiripala's fantastic Meteor APM for monitoring performance of Meteor applications. It is very handy for finding issues in your applications and infrastructure.
While I run the Meteor apps locally for devleopment, I find it nice to have APM initialize on just my test servers so I know the source of data APM is anaylizing and displaying. It dawned on me that it would be pretty simple to limit the instace where APM initializes. To do this, I wrapped Apm.connect
in a conditional statement which checks the root URL of the application. Next, I make sure to set the ROOT_URL
environment variable before launching Meteor to run the application.