Node.js Agent Release Notes

Node.js Agent Release Notes

2017, May 11 - 14:15 Download

Bug fixes

  • Fixed a transaction state loss introduced in Node 7.10.0 when using net.createConnection.

    Added a new segment for net.connect, net.createConnection, and http.Agent#createConnection. Sockets created within a transaction also have their emit bound to the segment.

  • Fixed a typo about the name of the default configuration file. Thanks Jacob LeGrone (@jlegrone)!

2017, May 3 - 13:57 Download


  • Dropped support for Express <4.6.

New features

  • Improved API for writing web framework instrumentation.

    Introduced a new WebFrameworkShim class for writing instrumentation. This shim can be accessed using the newrelic.instrumentWebframework API method.


  • Incorporated fixes and features from 1.38.0, 1.38.1, and 1.38.2.

  • Only one transaction is created for each request emitted by a server.

    Previously we created a transaction for each listener on the request event.

  • Fixed the beta sign up link in the readme.

  • Rewrote instrumentation for Connect, Director, Express, Hapi, and Restify.

    These instrumentations were rewritten using the new WebFrameworkShim. As a consequence of this rewrite, all our instrumentations now have feature parity, meaning every instrumentation will create Middleware metrics for your server.

    Tutorials on using the new instrumentation shim can be found on our API docs:

  • Removed express_segments feature flag.

    This configuration previously controlled the creation of middleware metrics in our Express instrumentation. With the move to the WebFrameworkShim this was dropped.

2017, May 2 - 15:01 Download

New features

  • Error messages are redacted in High Security Mode now.

  • New configurations were added for disabling some New Relic API methods. These default to enabled and are all disabled in High Security Mode.

    • api.custom_parameters_enabled controls newrelic.addCustomParameters()
    • api.custom_events_enabled controls newrelic.recordCustomEvent()
    • api.notice_error_enabled controls newrelic.noticeError()
  • Updated the default value for transaction_tracer.record_sql to obfuscated.

    This value was previously off by default. This change brings the New Relic Node Agent defaults in line with other New Relic Agents.

Bug fixes

  • Our when instrumentation better detects when a module is actually when.

    Thanks to Pasi Eronen (@pasieronen) for the contribution!

  • Quiet a warning in our native promise instrumentation on Node 0.10.

  • Fixed a bug in the generic pool instrumentation affecting version 3.

2017, March 30 - 12:05 Download

Bug fixes

  • When.js hooks similar to Promise.onPotentiallyUnhandledRejection now function as intended.

    Previously, hooks like Promise.onPotentiallyUnhandledRejection would not work due to the way the agent wraps the promise constructor. When.js expects these handles to be assigned directly onto the promise constructor, and our wrapper was intercepting the assignment. The wrapper will now properly proxy these values and assign them onto the original constructor, restoring the proper behavior.

  • Express route parameters will now be properly attached to the corresponding transaction.

    Previously, our express instrumentation would read the route parameters and place them on the segment responsible for matching the parameters. This behavior did not place the parameters on the transaction that the segments belonged to, causing the parameters to not show up properly on transaction traces and transaction events.

2017, March 17 - 16:50 Download

Bug fixes

  • Fixed issue with when.js instrumentation not preserving all properties on wrapped Promise constructor.

    Previously, the when.js instrumentation would cause an unhandled exception when private methods on the Promise constructor were called (e.g. when adapting functions that do not use promises).

2017, March 16 - 14:30 Download


  • We're excited to announce the addition of a new Node VMs page to the UI that provides a curated view of the cpu, memory, garbage collection, and event loop metrics that we have added over the past several releases of the node agent and native-metrics module.

    For more information, see our documentation.

  • Added instrumentation of When.js promise library.

    Previously, the transaction state could get lost when multiple promises resolved close to each other.

  • Fixed name of environment variable in error message when configuration file cannot be found. Thanks to @Maubic for the contribution!

  • Updated tests to work with the latest version of Node 7.

2017, February 22 - 14:54 Download

New Features

  • Added support for recording interfaces that return promises instead of taking callbacks. See RecorderSpec.promise for more details.

    Thanks to Gert Sallaerts (@Gertt) for this contribution.


  • Incorporated fixes and features from 1.36.2, 1.37.0, and 1.37.1.

  • Domains are no longer preemptively instrumented, thus applications that do not use domains will not load the domain module.

    Including the domain module causes a small amount of extra overhead in other core libraries that must keep the domain state set correctly.

2017, February 16 - 17:00 Download


This release is the same as v1.37.1 except it has been re-published to npm due to an issue with shrinkwrapping the previously published package.

2017, February 16 - 14:59 Download


This release has been re-published to npm as 1.37.2. Please use version 1.37.2 or higher.


  • Agent now wraps emit on http request/response objects instead of relying on listeners.

  • Improved documentation for newrelic.noticeError() and ignore_status_codes configuration.

    The documentation now makes it clear that errors recorded using noticeError() do not obey the ignore_status_codes configuration value.

  • Removed unused yakaa dependency.

Bug fixes

  • Fixed a bug in normalization rules when replacements do not maintain initial /.

  • Better de-duplication of errors when the same error instance is used multiple times.

  • Server-side naming rules are now applied even when user defined ones have matched.

  • Errors reported outside of a transaction now include their stack trace on the error analytics page.

  • A potential stack overflow in trace serialization has been removed.

  • Fixed an issue with our Express and domain instrumentation related to a loss of transaction state that could result in incorrect transaction names, traces, and events.

  • Nested background transactions now report the correct number of metrics.

2017, February 9 - 11:02 Download

New features

  • The agent now reports event loop metrics on supported platforms.

    The agent will now record the number of event loop ticks per minute and CPU time spent in each tick. This feature requires v2.1.0 or higher of the optional @newrelic/native-metrics module, and is supported on Node versions 0.12, 4, 6, and 7.
    You can read more about it on our docs site!

Bug fixes

  • The agent no longer creates a segment for each row returned from a PG query when the pg-query-stream module is used.

  • Internal properties used in our promise instrumentation are now non-enumerable to prevent unexpected keys showing up for clients.

  • Agent now uses safe stringification when encoding payloads in order to prevent an issue with circular references.

  • Fixed issue with the agent holding the process open when retrying to connect to the collector.


  • Removed io.js from our test suite, since it has not been supported for some time.

  • Quieted a log message warning users about their own settings.

  • Fixed typo in a log message. Thanks to Dave Bobak (@davebobak) for the contribution.

2017, January 26 - 14:14 Download

Bug fixes

  • Fixed issue with timing Redis operations when called without a callback.

    Previously these operations would continue to be timed until the transaction ended, and as a result reported incorrect times.

  • Transactions that result in a 404 HTTP error are now named "(not found)".

    Previously these transactions were reported with no name (e.g. get /).

  • When the newrelic.js configuration file is not present, the agent now logs a message to the console and no longer prevents the app from starting up.

2017, January 25 - 11:29 Download


  • Rewrote the cassandra-cql and memcached instrumentations using the DatastoreShim.

  • Improved instrumentation matching.

    Previously, the agent would determine which instrumentation would run for a given module being loaded using the basename of the file path. This lead to false positives (e.g. myapp/lib/express.js would trigger the express instrumentation) which we previously just ignored. Matches are now determined using the string passed to require. This means you can now match local relative paths (./lib/something) as well as package-relative paths (amqplib/callback_api).

2017, January 12 - 11:23 Download


  • Incorporated fixes from 1.36.1
2017, January 12 - 10:32 Download

Bug fixes

  • Stop collecting URL parameters from the HTTP referer header

    The Node agent collects the request headers during an error trace to help determine the root cause of problems. The referer header is the URI that identifies the address of the webpage that linked to the resource being requested. It is possible that the referer URI may contain sensitive information in the request query parameters. New Relic has found that the query parameters are not properly stripped during the error trace. This update fixes this by stripping the query parameters from the referer in the request header before sending this data to New Relic.

    This release fixes New Relic Security Bulletin NR17-01.


  • Improved logging of modules that did not get instrumented.
2017, January 5 - 11:19 Download

New features

  • The @newrelic/native-metrics module is now an optional dependency of the agent.

    Now npm will attempt to install the module when the agent is installed. If it fails for whatever reason, the agent itself will still be installed correctly and the rest of the npm install will finish normally.


  • Incorporated new features and fixes from 1.34.0, 1.35.1, and 1.36.0
2016, December 21 - 14:15 Download

New Features

  • Added CPU metric gathering to Node.js versions <6.1

    As of this release the agent will attempt to gather CPU usage metrics via the optional @newrelic/native-metrics module.

  • Added additional memory usage classification metrics.

    The agent will now report memory metrics that break down memory by its current use.

    For more information on these features, see our documentation.

2016, December 13 - 12:20 Download

Bug fixes

  • Removed automatic installation of @newrelic/native-metrics.

    Due to the way npm v3+ flatten dependencies, a bug in the version of npm packaged with Node v5, and npm v1's ungraceful handling of scoped packages we have opted to not automatically install this module.

    If you would like to see native metrics for your application, you can add the @newrelic/native-metrics module to your package.json and the Node Agent will automatically pick it up.

  • Corrected attribution of the Bluebird patch in the last release's notes.

    Thanks to Matt Lavin (@mdlavin) for this correction!

2016, December 12 - 14:00 Download


This release has been unpublished from Please use version 1.35.1 or higher.

New features

  • The agent will now report garbage collection statistics on supported platforms.

    On node versions 0.10, 0.12, 4, 6, and 7 the agent will now record the time spent in, the number of, and type of garbage collection cycles. You can read more about it on our docs site!

Bug fixes

  • The agent no longer double counts MySQL query times when using a connection pool.

    Previously, when using a pool of connections a query done through the pool would be recorded as the time it took on the pool, as well as the connection, effectively counting the time twice. This is no longer the case.

  • The agent will no longer lose transaction state across Bluebird's promise.nodify.

    Thanks to Matt Lavin (@mdlavin) for this contribution!

2016, November 10 - 16:26 Download

New features

  • The agent now collects CPU metrics when running under Node 6.1.0 and higher.

    Node 6.1.0 introduced an API to get CPU time usage of the running Node process. We are now collecting this data as new metrics.

  • The agent now has a separate configuration for audit logging.

    Previously the data that the agent sends to the collector was logged only in trace logging mode, making the logs unnecessarily large and noisy. The agent can now include this data independent of the logging level using separate configuration settings.

  • A new API method addCustomParameters() has been added to allow adding multiple custom parameters at once. Thanks to Austin Peterson (@AKPWebDesign) for this contribution!


  • Updated tests to run on Node 7.

    Node 7 is officially supported as of the previous release, v1.33.0.

  • The shutdown() API now waits for connection to collect pending data.

    When a flag to collect pending data is provided to the shutdown() method, the agent now ensures a connection to the collector has been established. This is useful when the Node process is short-lived, such as in AWS Lambda.

  • Added running the nsp (Node Security Platform) tool to the test suite to help with detecting security-related vulnerabilities.

Bug fixes

  • The setIgnoreTransaction() API now works for background transactions.

  • Fixed issue with Synthetics result not displaying a link to the corresponding transaction trace.

2016, November 9 - 16:39 Download


  • Incorporated new features and fixes from v1.30.4, v1.30.5, v1.31.0, v1.32.0, and v1.33.0.