Notes
Fixed bug where failure to retrieve CPU/Memory details for certain Linux distros could result in a crash.
parseProcCPUInfoandparseProcMeminfonow check fornullinput prior to processing.Updated README to favor using
-rto load the agent vsrequire('newrelic').Updated
@newrelic/test-utilitiesto 6.1.1 and applied a global sampling value of 10 for versioned tests.Migrated utilization unit tests from mocha to tap.
Migrated logger unit tests from mocha to tap.
Cleaned up or added future removal comments for several deprecation warnings.
Added a script and corresponding CI job that will check for PRs that have been merged and not release and notify the team in a private slack channel.
Updated the versioned test runner to always run against minor versions.
Fixed a high severity npm audit failure.
Notes
Added full support for Fastify v2 and v3. Fastify instrumentation is now GA.
- Removed fastify feature flag.
 - Instrumented Fastify routes by wrapping 
addHook. - Added middleware mounting for fastify v3.
 - Fixed capturing of mount point for middleware naming.
 - Fixed the WebFramework spec definitions for Fastify middleware and route handlers to properly retrieve the IncomingMessage from a request object.
 - Added proper definition to middleware handlers so that the relationship to consecutive middleware and route handler are siblings and not direct children.
 
Added experimental instrumentation for the undici http client behind a feature flag.
To enable undici support, add the following into your config:
{ feature_flag: { undici_instrumentation: true } }. The support for undici client is Node.js 16.x as it takes advantage of the diagnostics_channel. Lastly, you must be using v4.7.0+ of the undici client for any of the instrumentation to work.Note: There are currently some state issues if requests to an app are made with keep alive and you have multiple undici requests being made in parallel. In this case, set feature_flag:
{ undici_async_tracking: false }which avoids these state issues at the cost of some broken segment nesting.
Notes
Deprecation Warning: Cross Application Tracing (CAT) has been deprecated and will be removed in a future major release. For applications that explicitly disable Distributed Tracing (DT) to leverage CAT, we recommend migrating to DT to avoid loss of cross-service visibility.
- Disables CAT by default. You must explicitly enable CAT along with turning off DT.
 - Adds a deprecation warning when CAT is enabled and active (DT disabled).
 
Fixed issue with
clearTimeoutthat could result in dropping parent segments or spans. This bug resulted in some MongoDB calls being dropped from Transaction Traces and Distributed Traces (spans): https://github.com/newrelic/node-newrelic/issues/922.Removed warnings from agent tests for
no-vareslint rule.Added support for Cassandra driver v4.0.0 and above.
Fixed issue where DT headers would not be processed by
transaction-shim.handleCATHeaders()when CAT was explicitly disabled. This primarily impactsamqplibinstrumentation.Transitioned aws-lambda.test.js to use Tap over Mocha.
Removed warnings from agent for
no-vareslint rule.Refactored
transaction-shim,httpandhttp-outboundto use centralized CAT methods inutil/catReplaced http-outbound test call to use example.com to avoid unpredictable connection resets.
Migrated sql query parser tests to tap
Added more API usage examples.
Added a README to the
examples/folder discussing how to use the examples.Fixed
message-shimtest assertion to avoid flakiness based on precision differences(ms vs ns)Applied new lint rules barring the use of
varand preferring the use ofconstwherever possible.
Notes
Enabled Distributed Tracing (DT) by default.
- Added ability to configure the maximum number of spans that can be collected per minute via 
span_events.max_samples_storedand environment variableNEW_RELIC_SPAN_EVENTS_MAX_SAMPLES_STORED. - Added supportability metric SpanEvent/Limit.
 
- Added ability to configure the maximum number of spans that can be collected per minute via 
 Added support for properly setting the
hostandportfor clustered MongoDB requests.Fixes issue where
.fastifyand.defaultproperties would be missing from thefastifyexport when instrumented.Instrumentation now sets
.fastifyand.defaultproperties to the wrappedfastifyexport function for fastify v3.Added the following environment variables for the corresponding configuration items:
config item:
transaction_events.max_samples_storedenv var:NEW_RELIC_TRANSACTION_EVENTS_MAX_SAMPLES_STOREDconfig item:
custom_insights_events.max_samples_storedenv var:NEW_RELIC_CUSTOM_INSIGHTS_EVENTS_MAX_SAMPLES_STOREDconfig item:
error_collector.max_event_samples_storedenv var:NEW_RELIC_ERROR_COLLECTOR_MAX_EVENT_SAMPLES_STORED
Converted several unit tests to use the tap API.
Changed assertions for two HTTP error message tests to work with all versions of Node.js.
Notes
Added a new feature flag
unresolved_promise_cleanupthat defaults totrueonly whennew_promise_trackingfeature flag is set totrue. If disabled, this will help with performance of agent when an application has a lot of promises. To disable, in your config setfeature_flag.unresolved_promise_cleanuptofalseor pass in the environment var ofNEW_RELIC_FEATURE_FLAG_UNRESOLVED_PROMISE_CLEANUP=falsewhen starting application with agent.WARNING: If you set
unresolved_promise_cleanuptofalse, failure to resolve all promises in your application will result in memory leaks even if those promises are garbage collectedSupported using
connectto route middleware calls.Removed stubbed out tests in memcached unit tests.
Refactored
dropTestCollectionsin mongo versioned tests to await for alldropCollectionoperations to be finished before closing connection and returning.Ported remaining mocha tests in
test/unit/instrumentationto exclusively use tap.Added
@newrelic/eslint-configto rely on a centralized eslint ruleset.Removed integration tests for oracle.
Converted config unit tests to fully use tap API and extracted related tests into more-specific test files.
Added a pre-commit hook to check if package.json changes and run
oss third-party manifestandoss third-party notices. This will ensure thethird_party_manifest.jsonandTHIRD_PARTY_NOTICES.mdup to dateReplaced
JSVwithajvfor JSON schema validation in tests.Removed
throughin lieu of core Node.js implementation of Transform stream in tests.
Notes
Added necessary instrumentation to support v4 of
mongodb.- Explicitly enabled APM for 
mongodbinstrumentation(client.monitorCommands = true) 
- Explicitly enabled APM for 
 Fixed issue where Promise based
pg.Client.querytimings were always in sub-millisecond range.Fixed bug where
API.shutdownwould not harvest or keep process active effectively after an agent restart.The agent will now correctly update its state to 'started' after a reconnect has completed.
Added an eslint rule to verify every file includes the copyright statement.
Fixed the
homepagefield in package.json to usehttpsin the link to the github repo. Thank you @pzrq for the contribution.
Notes
Added official parity support for Node 16.
BREAKING: Dropped Node v10.x support. For further information on our support policy, see: https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/compatibility-requirements-nodejs-agent.
- Upgraded 
@newrelic/superagent@newrelic/aws-sdk@newrelic/koa@newrelic/native-metricsand@newrelic/test-utilitiesto the latest major versions. - Refactored creation of span event aggregator to prevent crash of gRPC when running on invalid Node.js version.
 - Added check for minimum 
nodeversion >= 12. - Set package.json engines 
nodefield >= 12 andnpmfield to >=6. - Removed Node v10 from ci workflow and smoke-test version matrix.
 - Removed comments around replacing 
temporarilyOverrideTapUncaughtBehaviortest helper function. - Removed non-applicable semver checks for versions the agents no longer supports.
 
- Upgraded 
 BREAKING: The agent no-longer includes the New Relic certificate bundle automatically when using the 'certificates' configuration (commonly with proxies). If you find this breaking your current environment, you may leverage a feature-flag to temporarily restore this functionality. Example configuration:
feature_flag: { certificate_bundle: true }. In this case, we recommend getting a certificate bundle for your environment such as the one from Mozilla. The New Relic bundle and feature flag will be fully removed in next major release.- Defaulted config.feature_flags.certificate_bundle to false.
 
BREAKING: Removed
serverless_modeas a feature flag.The standard
serverless_modeconfiguration still exists.Added hapi 19 and 20 to versioned tests for Node.js
>=12and<16Added hapi
^20.1.2to versioned tests for for Node.js>=16Upgraded tap to v15.
Upgraded https-proxy-agent to v5.0.0.
Updated linting to always use latest LTS Node version.
Updated CI and Smoke Test scripts to use setup-node@v2.
Added
no-const-assignto eslint ruleset.Pinned mongodb versioned tests to <4.0.0.
Bug Fixes
- Fixed bug where promise-based cursor methods would not properly measure the duration of execution.
 
Improvements
Moved all integration tests that required secrets to the smoke folder.
Fixed LASP/CSP tests so they don't skip on runs where secrets are available.
Modified self-signed SSL cert to use 'localhost' instead of 'ssl.lvh.me' for SSL testing.
Removed unnecessary trace observer configuration validation for host and port.
Bug Fixes
- Fixed loading config from the main module's directory. Thank you @alexpls for the contribution.
 
Support statement:
- New Relic recommends that you upgrade the agent regularly to ensure that you're getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.
 
Features
Added default support for config files with a 'cjs' extension (
newrelic.cjs) in addition tonewrelic.js.Thank you to @Maddemacher for the contribution!
Added ability to specify a custom config file name with the
NEW_RELIC_CONFIG_FILENAMEenvironment variable.Thank you to @Maddemacher for the contribution!
Improvements
Bumped
@newrelic/test-utilitiesto ^5.1.0.Replaced deprecated
util.isArraywithArray.isArray.Removed unused
listenerCountmethod onShim.Properly bootstraped husky as a
preparescript.Removed commented-out console log from fastify instrumentation.
Bug Fixes
Fixed issue when using the 'new_promise_tracking' feature flag where segment mapping may not get cleaned up for promises which never resolve but have all references removed (and thus get cleaned up by GC).
Adds segment cleanup on 'destroy' when using 'new_promise_tracking' feature flag in addition to the existing 'promiseResolve' hook. Unfortunately, preventing leaks for this edge-case does come with additional overhead due to adding another hook. Memory gains from feature flag usage should still be worth the trade-off and reduced garbage collection may offset perf/CPU impacts or event still result in net gain, depending on the application.
Support statement:
- New Relic recommends that you upgrade the agent regularly to ensure that you're getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.