The New Relic Node.js agent supports the amqplib RabbitMQ client library, giving you insight into the performance of your message processing, for both incoming and outgoing messages.
The APM UI will show transactions initiated via RabbitMQ message receipt (subscribe/consume messages) as Message background tasks. Message creation via RabbitMQ also appears in transaction traces.
This feature requires New Relic Node.js agent version 2.0.0 or higher.
One way to increase responsiveness of web applications is to delegate work to background processes. Message queues are commonly used for this inter-process communication.
In the context of message queuing systems, applications typically interact with message brokers to send and receive messages. The
amqplib client library allows Node.js applications to interface with message brokers that implement the Advanced Message Queueing Protocol (AMQP) 0.9 or higher.
New Relic's Node.js agent shows messages sent and received using the RabbitMQ client library. With this visibility, you can see details including:
- Number of messages produced by your app
- Time your app spends publishing messages
- Time your app spends processing "consumed" messages
APM conveniently groups and reports operations that interact with queues. By analyzing this information, you can more easily identify bottlenecks and areas for performance improvement in your message passing architecture.
Supported entry points for queue operations appear as
Put (publish a message) or
Take (receive a message) in APM's user interface.
Publish a message (
Receive a message (
Queue operations appear on APM's Transactions page for the selected app. The
Take metrics appear in the Breakdown table and are categorized as
MessageBroker metrics. Here is an example:
one.newrelic.com > APM & services > Applications > (select an app) > Transactions > (select a transaction): The transaction's Breakdown table categorizes queue operations as
MessageBroker metrics and labels them as
Put (publish a message) or
Take (receive a message).
The Transaction trace summary page may show
Take operations in the Slowest components section. For example:
one.newrelic.com > APM & services > Applications > (select an app) > Summary > (select a transaction trace): In this example, the selected transaction trace's Summary shows RabbitMQ operations in the colored bar chart. The Slowest components section also lists the RabbitMQ
The Transaction trace page also includes a dedicated Messages tab that shows a summary of the message activity that occurred as part of the transaction.
You can select transaction traces from the app's Summary or Transactions pages in APM.