require()statements explicitly reference
This solves a problem when requiring/importing
newrelic from a Typescript file.
- Check if
process.mainModule.filenameexists before using in missing config file check.
When the agent is preloaded with Node's
mainModule is not yet defined when the agent checks for a config file, resulting in a
TypeError in the event that no config file exists. Defaulting to the file path being executed in
process.argv ensures that the app will not crash when preloaded without a config file.
- Updated dev dependency tap to
- Fixed identification of errors with express.
Previously the call
next('router') was considered an error. This is actually valid usage of express and will no longer generate an error.
This legacy debug configuration was never used since trace-level logging provides everything this did and more.
- Upgraded optional dependency
With this update comes pre-built binaries for Node 5 and 7. GC metrics are also now aggregated in C++ until the agent is ready to harvest them instead of hopping into JS for each event.
- Added additional checks to
uninstrumentedensuring that files with names matching instrumented modules do not result in a false uninstrumented status.
For example, some users load config/env info before the agent. In that case, a file responsible for exporting DB config information (
config/redis.js), may result in a false uninstrumented status, because the agent would interpret
redis.js as the module itself.
Fixed metric merging when using debug.internal_metrics.
The debug metrics cache would cause timestamps for harvested metrics to get stuck at agent startup. This will no longer happen, and the debug cache is reset each harvest.
- Modularized configuration constants to improve readability.
unhandledRejectionreporting when using
- Replaced all uses of
- Completed TODOs regarding the Node 0.10 and 0.12 deprecation.
- Added PriorityQueue serialization benchmarks.
The agent no longer resizes the metric timeslice start time to be the earliest start time of the transactions that finish during the timeslice.
Background transactions created may now be named through
Previously, the agent didn't respect the transaction naming precedence for background transactions. Background transaction naming behavior is now in line with web transaction behavior.
Logger no longer tries to create very large log messages.
When a message is created that would be too large to log, a process warning is emitted.
The agent will now respect event count limits when merging data from a failed send.
Previously, when merging data into an event pool the agent wouldn't maintain the size limit of the reservoir.
Added check for a route prefix when wrapping Hapi route handlers.
Previously, route prefixes specified via plugin options weren't being included in transaction names. Now, if the agent finds a route prefix associated with a given realm, it is prepended to the route path in the transaction name.
Added PriorityQueue class for collecting events.
This replaces the Reservoir class for event sampling. Using priority sampling allows the agent to maintain randomness across a given time period while improving the chances that events will be coordinated across Transaction, Error, and Custom event pools.
The agent will now allow external instrumentation modules to fail in a safe way.
Previously, the agent would stop running if an externally loaded instrumentation failed for any reason. Due to the way external instrumentations can be updated independently, the agent should allow them to fail and carry on after logging a warning.
The agent can now be configured to redact error messages on collected errors.
The agent can now be configured to disallow attribute include patterns to be specified.
Updated logic around wrapping route handlers when
configobject is present.
Before, the agent would only attempt to wrap
configobject was present, without defaulting to the root
handlerif it didn't exist.
BREAKING: Updated the version of
https-proxy-agentto v2.x - Dropped support for v0.10 and v0.12 of node.
The version of
https-proxy-agentused in the agent has a known security issue you can read about here: https://snyk.io/vuln/npm:https-proxy-agent:20180402 In order to resolve this issue, the dependency had to be updated to at least v2.2.0, which only supported node versions >=4. The update to this dependency forces the incompatibility of the agent with versions 0.10 and 0.12 of node.
In order to use use the Node.js agent, please upgrade node to version >=4, or you can continue to use the agent on node versions 0.10 and 0.12 by pinning the agent to v3.
You can read more about the issue here: https://docs.newrelic.com/docs/using-new-relic/new-relic-security/securi...
Added a type check to attribute validation, restricting values to primitive types (but not
Previously the agent was only enforcing byte limits on string values, resulting in overly large arrays being collected. This brings the agent in line with other language agents.
DatastoreShimwill now respect specified
Previously on methods like
afterhandler would be dropped. The property is now correctly propagated to the underlying
The agent will now check that a specified parent segment is part of an active segment before running a method under instrumentation.
Previously the agent would unconditionally run a method under a specified parent. The shim expects the parent to exist and be active, and will throw errors in the case where the parent belongs to an inactive transaction.
newrelic.startSegment(), which replaces
This new API method allows you to create custom segments using either callbacks or promises.
Fixed bug in
preroute config option in Hapi instrumentation.
Only applies to Hapi v16 and below. The pre handler wrapping was not properly returning in cases when the element was a string referring to a registered server method, and as a result these elements would be replaced with
Added @newrelic/koa as a dependency.
This introduces instrumentation for Koa v2.0.0 or higher. It will be treated as first-party instrumentation within the agent, but publishing it as a separate module allows it to be installed independently according to users' needs.
Refactored instrumentation hooks to work with modules.
With this change it is now possible to link against external instrumentation modules.
Promise based web framework middleware instrumentation now supports callback based sequencing.
Previously, a promise based middleware was assumed to continue to the next middleware once the promise it returned resolved. This assumption has been relaxed to allow for a callback to be supplied to the middleware to invoke the next middleware.