[Node.js] how do we disable the automated instrumental for node.js message queue

I’m using node.js with newrelic agent provided via npm
I’m currently using the following

  • node.js 12.20 (will be upgrading to 16 really soon)
  • amqplib 0.5.2
  • newrelic 8.6.0
  • rabbitmq 3.8.23

newrelic is installed with the following command
npm install --save newrelic

this is a pretty old app that we are running, and we wanted to add some instrument, it is mainly a background job type of server. we use a single queue with different message type, and process different functions (message handler) based differently based on the message type.

when we add newrelic agent, it gave us out of the box message queue transaction which could be great, but because of the way we manage our queue, the newrelic dashboard is not being helpful with giving us information of how each of the message handler is performing.

Everything is lump into a single transaction, and most of the functionality becomes not so useful.

Is there a way to turn this off, and we will define our own background job transaction.
I can’t find anything in the documents about turning this off.

Hello @weisheng -

Good to see you in the community again!

If I understand you correctly, you want to disable transaction events from being collected by the Node agent. If I have that right, then you should be able to do this via the agent configuration. Here’s some documentation about that:


Let me know if this does not solve your problem.

1 Like

Hey @hross, thanks for the reply.

Would this solution also disable all custom transaction?

To reply to my own question: the solution provided by @hross will also prevent all custom transaction from being collected.