Skip to content

Commit

Permalink
chore(newrelic): add newrelic
Browse files Browse the repository at this point in the history
  • Loading branch information
lefnire committed Jan 30, 2014
1 parent 3660f1a commit 5b06392
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ npm-debug.log
lib
public/bower_components
build
newrelic_agent.log

src/*/*.map
src/*/*/*.map
Expand Down
1 change: 1 addition & 0 deletions .nodemonignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ Gruntfile.js
CHANGELOG.md
.idea*
.git*
newrelic_agent.log
25 changes: 25 additions & 0 deletions newrelic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* New Relic agent configuration.
*
* See lib/config.defaults.js in the agent distribution for a more complete
* description of configuration variables and their potential values.
*/
var nconf = require('nconf')
exports.config = {
/**
* Array of application names.
*/
app_name : ['HabitRPG'],
/**
* Your New Relic license key.
*/
license_key : nconf.get('NEWRELIC'),
logging : {
/**
* Level at which to log. 'trace' is most useful to New Relic when diagnosing
* issues with the agent, 'info' and higher will impose the least overhead on
* production applications.
*/
level : 'trace'
}
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"domain-middleware": "~0.1.0",
"swagger-node-express": "git://github.com/lefnire/swagger-node-express#habitrpg",
"passport": "~0.1.18",
"passport-facebook": "~1.0.2"
"passport-facebook": "~1.0.2",
"newrelic": "~1.3.0"
},
"private": true,
"subdomain": "habitrpg",
Expand Down
2 changes: 2 additions & 0 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ var server;

// ------------ Setup configurations ------------
utils.setupConfig();
if (nconf.get('NODE_ENV') === 'production')
require('newrelic');

// ------------ MongoDB Configuration ------------
mongoose = require('mongoose');
Expand Down

0 comments on commit 5b06392

Please sign in to comment.