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_stored
and 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
host
andport
for clustered MongoDB requests.Fixes issue where
.fastify
and.default
properties would be missing from thefastify
export when instrumented.Instrumentation now sets
.fastify
and.default
properties to the wrappedfastify
export function for fastify v3.Added the following environment variables for the corresponding configuration items:
config item:
transaction_events.max_samples_stored
env var:NEW_RELIC_TRANSACTION_EVENTS_MAX_SAMPLES_STORED
config item:
custom_insights_events.max_samples_stored
env var:NEW_RELIC_CUSTOM_INSIGHTS_EVENTS_MAX_SAMPLES_STORED
config item:
error_collector.max_event_samples_stored
env 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_cleanup
that defaults totrue
only whennew_promise_tracking
feature 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_cleanup
tofalse
or pass in the environment var ofNEW_RELIC_FEATURE_FLAG_UNRESOLVED_PROMISE_CLEANUP=false
when starting application with agent.WARNING: If you set
unresolved_promise_cleanup
tofalse
, failure to resolve all promises in your application will result in memory leaks even if those promises are garbage collectedSupported using
connect
to route middleware calls.Removed stubbed out tests in memcached unit tests.
Refactored
dropTestCollections
in mongo versioned tests to await for alldropCollection
operations to be finished before closing connection and returning.Ported remaining mocha tests in
test/unit/instrumentation
to exclusively use tap.Added
@newrelic/eslint-config
to 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 manifest
andoss third-party notices
. This will ensure thethird_party_manifest.json
andTHIRD_PARTY_NOTICES.md
up to dateReplaced
JSV
withajv
for JSON schema validation in tests.Removed
through
in lieu of core Node.js implementation of Transform stream in tests.
Notes
Added necessary instrumentation to support v4 of
mongodb
.- Explicitly enabled APM for
mongodb
instrumentation(client.monitorCommands = true
)
- Explicitly enabled APM for
Fixed issue where Promise based
pg.Client.query
timings were always in sub-millisecond range.Fixed bug where
API.shutdown
would 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
homepage
field in package.json to usehttps
in 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-metrics
and@newrelic/test-utilities
to 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
node
version >= 12. - Set package.json engines
node
field >= 12 andnpm
field to >=6. - Removed Node v10 from ci workflow and smoke-test version matrix.
- Removed comments around replacing
temporarilyOverrideTapUncaughtBehavior
test 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_mode
as a feature flag.The standard
serverless_mode
configuration still exists.Added hapi 19 and 20 to versioned tests for Node.js
>=12
and<16
Added hapi
^20.1.2
to versioned tests for for Node.js>=16
Upgraded 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-assign
to 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_FILENAME
environment variable.Thank you to @Maddemacher for the contribution!
Improvements
Bumped
@newrelic/test-utilities
to ^5.1.0.Replaced deprecated
util.isArray
withArray.isArray
.Removed unused
listenerCount
method onShim
.Properly bootstraped husky as a
prepare
script.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.
Features
Added
flaky_code
andsuccess_delay_ms
handling of flaky grpc connections to infinite tracing.Logged all New Relic metadata env vars at startup.
Improvements
Updated third party notices and manifest for husky and lint-staged.
Updated redis versioned tests to use unique DB indexes per file to avoid collisions and flushing of in-progress tests.
Pinned hapi 17 versioned tests to only minor/patch versions within 17.x.
Bumped timeout for redis versioned tests.
Wired up husky + lint staged to execute linting on all changed files in pre-commit hook.
Added resources to README to highlight external modules that customers should be aware of and possibly use for their applications.
Handled a proxy misconfiguration of collector and log an actionable warning message.
Fixed images for improved reader experience.
Thank you to @henryjw 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.
Fixes
Fixed issue with
new_promise_tracking
feature flag functionality where segments for ended transactions would get propagated in certain cases by promises that had no continuations scheduled (via await or manually).If you are experiencing high overhead levels with your promise usage and the agent attached, we recommend testing your application with
new_promise_tracking
set to true to see if overhead is reduced. You'll also want to verify your data is still being captured correctly in case it falls into a known or unknown limitation of this approach.NOTE: With this new functionality turned on, chaining of promise continuations onto an already resolved promise across an async hop (scheduled timer) will result in state-loss. This is a less-common use-case but worth considering with your applications.
Importante
Deprecation Warning: The certificate bundle automatically included by New Relic when using the certificates
configuration (commonly with proxies) will be disabled by default in the next major version. This is currently targeted for sometime in May. The bundle will be fully removed in later major versions. We recommend testing with the 'certificate_bundle' feature flag set to false
to determine if you will need to modify your environment or setup your own appropriate bundle. Example configuration: feature_flag: { certificate_bundle: false }
.
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.
New Features
Added new feature-flag 'new_promise_tracking' which enables cleaning up of segment references on native promise resolve instead of destroy. Includes usage of async-await. This can be enabled via
feature_flag: { new_promise_tracking: true }
in the config file orNEW_RELIC_FEATURE_FLAG_NEW_PROMISE_TRACKING=1
in your ENV vars.Applications with heavy promise usage or high-throughput applications with some promise usage should see moderate to high reduction in memory usage and may see a slight reduction in CPU usage. A bump in throughput may also be noticed in some cases. Results will vary by application.
If you are experiencing high overhead levels with your promise usage and the agent attached, we recommend testing your application with 'new_promise_tracking' set to true to see if overhead is reduced. You'll also want to verify your data is still being captured correctly in case it falls into a known or unknown limitation of this approach. NOTE: chaining of promise continuations onto an already resolved promise across an async hop (scheduled timer) will result in state-loss with this new functionality turned on. This is a less-common use-case but worth considering with your applications.
Fixes
Fixed memory leak introduced when Infinite Tracing is enabled.
When Infinite Tracing endpoints reconnected they would instantiate a new gRPC client prior to calling
client.recordSpan()
. It appears several objects created by grpc-js (ChannelImplementation
and child objects, promises, etc.) are held in memory indefinitely due to scheduled timers even when the client is no-longer referenced and the associated stream closed. We now avoid this situation by only creating the client once and then reusing it to establish new stream connections.
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.