Node monitoring without rest framework

Hello, guys. I am trying to use new relic in my node app, but is not a rest webservice. It an app that integrates with slack and sends/receives messages via sockets. Also I am using mongodb.

The problem is that the only activity registered is the deploy in the heroku server.

Is new relic plugin supporting this type of app?

@bsiqueira Thanks for posting to the forum! New Relic can instrument web sockets with custom instrumentation. Try creating a custom transaction by wrapping the handler you want to instrument with createWebTransaction() - don’t forget to end the call with endTransaction(). See more here:

Also question about noticeError
I’m writing small tool, that running in background. There is now REST in it at all.
I want to log errors, that handled in catch.
nr.noticeError('module in which error occurred', {type:'skip',mail:email,err:'detailed description'});
such a construction doesn’t work, could it be wrong because I’m not using transaction start?

HI @nosov. You are using the right API, and noticeError does not need to be in a transaction. It looks like your syntax is a little off, though. It takes an error object as the first parameter and an object for custom parameters as the second:

noticeError(error, customParameters) 

Here is the public documentation on noticeError. You would want to do something like:

var customParams = {
  type: 'skip',
  mail: email,
  err:' detailed description',
  moduleLocation: 'module in which error occurred'

nr.noticeError(err, customParams)