The New Relic Node.js Agent v2.x Instrumentation API is an enhanced API that allows you to easily write high-quality custom instrumentation that can be distributed independently from the agent.
With these enhancements, Node package authors can easily create and distribute New Relic instrumentation for modules together with packages, or as a separate package that can be optionally included by users. Node package consumers can independently author their own instrumentation for packages not currently supported out-of-the-box, or replace New Relic's out-of-the-box instrumentation with their own.
This release includes new API for writing custom instrumentation for datastores and web frameworks. If you have authored datastore driver or web framework packages that are currently un-instrumented, or are instrumented using pre-2.0 custom instrumentation, please give us your feedback.
This beta is a part of version 2.x of the New Relic Node agent. For Node.js, you must have version 0.10.x or higher.
To access the Beta agent, review and complete the New Relic Node.js Agent Beta Test Agreement. After approval, you will receive an email with a Beta token and further instructions.
Install the Beta agent
As with any beta software, New Relic strongly advises running this agent in a testing or staging environment before considering its use in a production environment.
Once you have received your Beta token, install the beta agent:
- Install the beta agent module via
npm install @newrelic/beta-agent.
- Update the package.json for your application to depend on
- Change the
require('newrelic')line at the top of your application's main module to
require('@newrelic/beta-agent')to reference the beta package. If you are not already including the agent, you will need to add this line.
- Set the
newrelic.jsfile or the environment variable
NEW_RELIC_BETA_TOKENto the beta token you received in your beta agreement approval email.
For additional Beta agent and API documentation (including examples, naming rules, and more) see the full beta documentation on Github.
Feedback and questions
If you encounter a bug or issue while running the beta, contact New Relic Support and mention the Node.js Agent v2.x Instrumentation API Beta in your message.
If you would like to provide general feedback or have any questions, see the Node.js Agent section of the New Relic Online Technical Community.
For more help
Additional documentation resources include:
- Node Agent 2.6.0 beta release notes
- Node Agent 2.5.0 beta release notes
- Node Agent 2.4.0 beta release notes
- Node Agent 2.3.1 beta release notes
- Node Agent 2.3.0 beta release notes
- Node Agent 2.2.0 beta release notes
- Node Agent 2.1.1 beta release notes
- Node Agent 2.1.0 beta release notes
- Node Agent 2.0.0 beta release notes