Question: rejoice -r and newrelic.js
I'm not sure if you're familiar with newrelic.js for Hapi or how it's implemented. However in the simpliest of implementations it only requires the inclusion of require('newrelic'); in you hapi server.
I've tried something similar to the following:
rejoice -c manifest.json -r 'path/to/newrelic'
Unfortunately I received the following response from the newrelic agent log.
{"v":0,"level":40,"name":"newrelic","hostname":"hostname","pid":1549,"time":"2015-09-18T21:52:24.200Z","msg":"The newrelic module must be the first module required.\nThe following modules were required before newrelic and are not being instrumented:\n\thapi"}
Seems like it's not possible and that my only option is to include there require('newrelic') either in a new hapi plugin definition, use a start.js script, or include the require('newrelic') in an existing plugin.
Thoughts?
Seems like this should work. I don't think its 'path/to/newrelic', it should just be newrelic and there should be a newrelic directory in the same directory rejoice is called. Can you try just 'newrelic' without the path? Let me know if you get the same result. I also assume that no where in your manifest.json you have a plugin that refers to newrelic (as to not confuse if the error is coming from -r or just another plugin).
Correct Lloyd, We do not have any plugins or code that makes reference to new relic anywhere else.
I've attempted to use -r 'newrelic' and this produced an error. I'll update with the error later. It's possible because newrelic is not referenced in the top-level package.json in the directory that rejoice is called from.
I'll do some more research. and get back to you.
I'm having trouble with this as well. I can get newrelic loaded, but it MUST be loaded BEFORE hapi in order to instrument it.
This has now been published as 2.2.1.