I'm hosting my Meteor app on Heroku and would like to have more monitoring capabilities rather than heroku logs --tail
. NewRelic could be a good option, though its node.js agent is still in beta. Does anybody tried to use it with Meteor app?
Meteor version as of time of writing: 0.9.4
. sweet. almost at 1.0!
OK I decided to edit this as this still gets upvotes with it being very outdated now.
As of Meteor 0.7+ or around that (can't remember exactly), require-ing in Meteor has been long changed from __meteor_bootstrap__.require
to Npm.require
var require = Npm.require;
var newrelic = require('newrelic');
This follows the Npm in a smart package pattern. Read more about it here
Excerpt for the lazy (thanks, Meteorpedia!):
NPM in a Smart Package
In your
package.js
, add a clause like:Npm.depends({ "walk": "2.2.1" });
Use
Npm.require
instead of require, e.g.var http = Npm.require('http');
But seriously, read the whole thing on meteorpedia. It's worth your time.
Alternatively, you can also use arunoda's excellent NPM smart package. Check it out here! https://github.com/meteorhacks/npm
Taken from this guide, You should be able to install the newrelic agent like any other npm module. In your meteor project folder:
$ cd .meteor/local/build/server
$ npm install newrelic
Now, you can use it via require
:
var require = __meteor_bootstrap__.require;
var newrelic = require('newrelic');
Then, configure your agent as specified here: https://github.com/newrelic/node-newrelic/#configuring-the-agent
if you need to use env vars specified in that guide, run the meteor
command with the env vars set e.g.:
$ NEW_RELIC_APP_NAME=mynodeapp meteor
That should be it, but I haven't really used it extensively because I haven't found any reason yet to do so. Let us know what you get to!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With