newrelic
Version:
New Relic agent
1,082 lines (681 loc) • 206 kB
Markdown
### v7.5.0 (2021-06-01)
* Added default support for config files with a 'cjs' extension (`newrelic.cjs`) in addition to `newrelic.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!
* 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.
* Bumped `@newrelic/test-utilities` to ^5.1.0.
* Replaced deprecated `util.isArray` with `Array.isArray`.
* Removed unused `listenerCount` method on `Shim`.
* Properly bootstraped husky as a `prepare` script.
* Removed commented-out console log from fastify instrumentation.
### v7.4.0 (2021-05-11)
* 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.
* Handled a proxy misconfiguration of collector and log an actionable warning message.
* Added `flaky_code` and `success_delay_ms` handling of flaky grpc connections to infinite tracing.
* Added resources to README to highlight external modules that customers should be aware of and possibly use for their applications.
* Logged all New Relic metadata env vars at startup.
* Fixed images for improved reader experience.
Thank you to @henryjw for the contribution.
### v7.3.1 (2021-04-14)
* 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: 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.**
**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 }`.
### v7.3.0 (2021-04-06)
* 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 or `NEW_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.**
* 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.
### v7.2.1 (2021-03-29)
* Dev-only sub-dependency bump of 'y18n' to clear npm audit warnings.
* Bumped @grpc/grpc-js to ^1.2.11.
* Bumped @grpc/proto-loader to ^0.5.6.
* Agent no longer propagates segments for promises via async-hooks when the transaction associated with the parentSegment has ended.
This change reduces the amount of context tracking work needed for certain rare edge-case scenarios involving promises.
* Fixed issue where capturing axios request errors could result in a memory leak.
The agent now clears error references on transaction end, which are not used for later processing. Errors returned from 'axios' requests contain a reference to the request object which deeper down has a handle to a promise in `handleRequestError`. The TraceSegment associated with that promise has a handle to the transaction, which through the error capture ultimately kept the promise in memory and prevented it from being destroyed to free-up the TraceSegment from the segment map. This change also has the benefit of freeing up some memory early for transactions held onto for transaction traces.
* Added active transaction check to `wrappedResEnd` to prevent unecessary work for ended transactions in the case of multiple `Response.prototype.end()` invocations.
### v7.2.0 (2021-03-23)
* Added feature flag to allow disabling of certificate bundle usage.
**Deprecation Warning:** The certificate bundle included by New Relic will be disabled by default and then 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 }`.
* The `NEW_RELIC_NO_CONFIG_FILE` environment variable is no longer needed to run the agent without a configuration file.
* If a configuration file is used with agent configuration environment variables, the environment variables will override the corresponding configuration file settings.
* Fixed bug where applications with multiple names on a dynamically named host (UUID like) would have instances consolidated, losing per-host breakdowns.
Removed 'host' from agent 'identifier' override to prevent server safety mechanism from kicking in. Host will still be used to identify unique agent instances, so was unnecessary to include as part of the identifier. This also resulted in additional processing overhead on the back-end. The identifier override is still kept in place with multiple application names to continue to allow uniquely identifying instances on the same host with multiple application names where the first name may be identical. For example `app_name['myName', 'unique1']` and `app_name['myName', 'unique2']`. These names would consolidate down into a single instance on the same host without the identifier override.
* Fixed bug where truncated http (external) or datastore segments would generate generic spans instead of appropriate http or datastore spans.
* Set distributed tracing to enabled in the `newrelic.js` template configuration file supplied with the agent.
* Added module root to shim.require() logging to aid debugging.
* Migrated from .npmignore to 'files' list in package.json to control which files are packaged.
Thank you to @JamesPeiris for the initial nudge via PR to move in this direction.
* Converted remaining collector unit tests to use tap API.
* Added linting to scripts in /bin folder.
Linting rules added are slightly more permissive than production rules and allow full ecma 8.
* Added new developer documentation to /docs folder.
This information is ported over from private GHE wiki used prior to going open source. S/O @astorm for original versions of the function wrapping and module instrumentation docs.
### v7.1.3 (2021-03-09)
* Bumped @grpc/grpc-js to ^1.2.7.
* Removed index-bad-config test which tested a no-longer possible use-case.
* Removed license-key test logic from serverless-harvest test.
Serverless mode does not require a license key as data transfer is handled by the integration.
* Added support metric to be able to track usage of cert bundle via usage of custom certificates.
* Removed requirement to configure application name when running in AWS Lambda (serverless mode).
Application name is not currently leveraged by New Relic for Lambda invocations. The agent now defaults the application name in serverless mode to remove the requirement of end-user configuration while handling cases if it were to be leveraged in the future.
* Stopped binding/propagating segments via `setImmediate` for ended transactions.
* Fixed bug where agent would attempt to call the 'preconnect' endpoint on the redirect host returned by the previous 'preconnect' call when reconnecting to the New Relic servers.
The 'preconnect' calls will now always use the original agent configuration value. Subsequent endpoints (connect, harvest endpoints, etc.) will continue to leverage the new redirect host value returned by 'preconnect.' The original config values are no-longer overridden.
* Fixed issue where a call to `transaction.acceptDistributedTraceHeaders` would throw an error when the `headers` parameter is a string.
* Improved clarity of logging between 'no log file' or disabled agent startup issues.
* Logs no-config file error to initialized logger (stdout) in addition to existing console.error() logging.
* Adds specific message to no config file separate from being disabled.
* Removed aws-sdk versioned test filtering.
* Removed unused Travis CI scripts.
### v7.1.2 (2021-02-24)
* Fixed bug where the agent failed to reconnect to Infinite Tracing gRPC streams on Status OK at higher log levels.
Node streams require all data be consumed for the end/status events to fire. We were only reading data at lower log levels where we'd use/log the data. This resulted in a failure to reconnect and 'ERR_STREAM_WRITE_AFTER_END' errors. The agent now always listens to the 'data' event, even if not logging, and will also reconnect (with 15 second delay) on any 'ERR_STREAM_WRITE_AFTER_END' error.
* Removed initial harvest send() call on streaming span event aggregator to prevent warning in logs.
* Bumped @newrelic/aws-sdk to ^3.1.0.
### v7.1.1 (2021-02-01)
* Upgrade @grpc/grpc-js to v1.2.5 to fix non-propagation of internal http2 errors
Now allows minor and patch auto-updates.
* Added workflow for publishing to npm when a v* tag is pushed to the repo.
* Fixes resolveMx test by using example.com for a valid exchange.
### 7.1.0 (2021-01-05):
* Fixed SQL traces being generated with invalid ID.
* Fixed log message for minimum supported Node.js version.
* Added Fastify v3 support.
* Fixed empty log message for Infinite Tracing connections.
* Upgraded grpc version.
* Fixed bug that prevented users from changing Infinite Tracing queue size.
### 7.0.2 (2020-12-01):
* Fixed a bug where the `http.statusCode` attribute was not being captured for an async invoked lambda.
* Fixed typos in code comments, documentation, and debugging logger messages.
Thank you @TysonAndre for the contribution.
### 7.0.1 (2020-11-17):
* Fixed a bug where spans queued up during backpressure situations would be improperly formatted and ultimately dropped when sent to an Infinite Tracing trace observer.
* Updated @grpc/grpc-js to version v1.2.0.
* Updated tap to clear up npm audit issues around lodash sub-dependency.
### 7.0.0 (2020-11-09):
* Added official parity support for Node 14
* Dropped Node v8.x support. For further information on our support policy,
see: https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/compatibility-requirements-nodejs-agent.
* Removed Node v8.x from CI
* Adds check that minimum Node version is >=10 and warns if >=15
* Sets Node engine to >=10
* **BREAKING** Dropped support for Node v8.x HTTP get() function signature
* strictly uses global.URL class in http core instrumentation
* removes Nodejs 8.x - 9.x checks
* Update New Relic Dependencies to versions with updated Node version support
* @newrelic/aws-sdk v3.0.0
* @newrelic/koa v5.0.0
* @newrelic/native-metrics v6.0.0
* @newrelic/superagent v4.0.0
* @newrelic/test-utilities v5.0.0
* **BREAKING** Removed deprecated setIgnoreTransaction API method
* **BREAKING** Removed deprecated httpResponseCode, response.status and
httpResponseMessage http response attributes
* **BREAKING** Removed the api.custom_parameters_enabled configuration item and
associated environment variable NEW_RELIC_API_CUSTOM_PARAMETERS. Please use
api.custom_attributes_enabled instead
* **BREAKING** Removed deprecated Distributed Tracing API methods,
createDistributedTracePayload() and acceptDistributedTracePayload()
* Finalized removal of ignored_params and capture_params
* Added additional logging to W3C Trace Context header creation
### 6.14.0 (2020-10-28):
* Updated README for consistency.
* Fixed issue where gRPC connection used for infinite tracing could throw if the server
shutdown during disconnect of an existing connection.
* Bumped @grpc/grpc-js to 1.1.7.
* Bumped @grpc/proto-loader to ^0.5.5.
* Infinite tracing logging and support metric improvements.
* Increased logging level of certain infinite tracing / gRPC errors.
* Decreased logging interval of dropped span warning for infinite tracing.
* Added additional support metrics and logging for infinite tracing.
* Fixed bug where errors would still be collected for transactions with ignored error
status codes in certain situations.
* Converted errors ignore unit tests to tap API.
* Added Node 14 to CI test coverage.
Many thanks to @jgeurts for the contribution.
### 6.13.2 (2020-10-13):
* Removed lodash as a development dependency
* Check for named pipe existence before each flush
This removes the cached value used in 6.13.1
* Update shim documentation
Thank you to @ronen-e for the contribution!
### 6.13.1 (2020-09-24):
* Fixed named-pipe check for lambda invocations to avoid race-condition.
Named-pipe existence will now be checked just prior to first write and then cached.
* Updated README with community-plus header.
* Updated README config copy example.
* Added Open Source Policy workflow.
* Removed repository CoC in favor of centralized CoC at org root.
### 6.13.0 (2020-08-25):
* Added ability for the agent to write to a named pipe, instead of stdout, when in serverless mode.
### 6.12.1 (2020-08-20):
* **Security fix:** Resolves an issue where transaction traces will still capture the request URI when the Node.js agent is configured to exclude the 'request.uri' attribute. This can be problematic for certain customers in environments where sensitive information is included in the URI. See security bulletin [NR20-02](https://docs.newrelic.com/docs/security/new-relic-security/security-bulletins/security-bulletin-nr20-02).
The request URI will now be excluded from transaction traces if the 'request.uri' attribute has been set to be excluded at either the top-level 'attributes.exclude' configuration or at the 'transaction_tracer.attributes.exclude' configuration.
### 6.12.0 (2020-08-11):
* Fixes obfuscation of SQL queries with large data inserts.
Special thanks to Tomáš Hanáček (@tomashanacek) for tracking down the issue and providing the fix.
* On failed instrumentation, prevent multiple requires from re-wrapping shims.
Special thanks to Ryan Copley (@RyanCopley) for the contribution.
* Upgrade `async` to `v3.2.0`. Special thanks to Yohan Siguret (@Crow-EH) for the contribution
* Bumped `@newrelic/native-metrics` to `^5.3.0`.
* Bumped `@newrelic/aws-sdk` to `^2.0.0`.
* Bumped `node-test-utilities` to `^4.0.0`.
* Bumped `@newrelic/superagent` to `^3.0.0`.
* Bumps `@newrelic/koa` to `^4.0.0`.
* Updated `SECURITY.md` with coordinated disclosure program link.
* Updated guidelines and templates for contributing to the project.
### 6.11.0 (2020-07-07):
* Updated to Apache 2.0 license
* Added CODE_OF_CONDUCT.md file
* Streamlined README.md file
* Updated CONTRIBUTING.md file
* Added additional guidance to bug report template
* Added copyright headers to all source files
* Added Distributed Tracing option to config file used for first time customers
* Converted some test files to Node-tap
* Removed "hidden" and unused code injector diagnostic capability
* Upgraded @grpc/grpc-js from 1.0.4 to 1.0.5
### 6.10.0 (2020-06-22):
* Additional Transaction Information applied to Span Events
* When Distributed Tracing and/or Infinite Tracing are enabled, the Agent will now incorporate additional information from the Transaction Event on to the currently available Span Event of the transaction.
* The following items are affected:
* `aws-lambda` related attributes
* `error.message`
* `error.class`
* `error.expected`
* `http.statusCode`
* `http.statusText`
* `message.*`
* `parent.type`
* `parent.app`
* `parent.account`
* `parent.transportType`
* `parent.transportDuration`
* Request Parameters `request.parameters.*`
* `request.header.*`
* `request.method`
* `request.uri`
* Custom Attributes
* Custom transaction attributes added via `API.addCustomAttribute` or `API.addCustomAttributes` will now be propagated to the currently active span, if available.
* **Security Recommendation:**
* Review your Transaction Event attributes configuration. Any attribute include or exclude setting specific to Transaction Events should be applied to your Span Attributes configuration or global attributes configuration. Please see [Node.js agent attributes](https://docs.newrelic.com/docs/agents/nodejs-agent/attributes/nodejs-agent-attributes#configure-attributes) for more on how to configure.
* Upgraded @grpc/grpc-js from 1.0.3 to 1.0.4
* Modified redis callback-less versioned test to use `commandQueueLength` as indicator redis command has completed and test can continue. This is in effort to further reduce these test flickers. Additionally, added wait for client 'ready' before moving on to tests.
* Updated force secret test runs to run on branch pushes to the main repository.
### 6.9.0 (2020-06-08):
* Added AWS API Gateway V2 Support to lambda instrumentation.
* Added 'transaction.name' intrinsic to active span at time transaction name is finalized.
This enables finding transaction name for traces that may not have a matching transaction event.
* Added 'error.expected' attribute to span active at time expected error was noticed.
* Dropped errors earlier during collection when error collection is disabled.
Error attributes will no longer show up on spans when error collection has been disabled. Other unnecessary work will also be avoided.
* Removed allocation of logging-only objects used by transaction naming when those log levels are disabled.
* Upgraded escodegen from 1.12.0 to 1.14.1.
* Upgraded readable-stream from 3.4.0 to 3.6.0.
* Upgraded @grpc/proto-loader from 0.5.3 to 0.5.4.
* Converted facts unit test to use tap API.
* Converted transaction 'finalizeName...' unit tests to use tap API.
* Added several items to .npmignore to prevent accidental publishing.
* Fixed Redis client w/o callback versioned test flicker.
Doesn't end transaction until error encountered. Increases wait time for first operation which has to complete for the second operation to be successful.
### 6.8.0 (2020-05-21):
* Bumped @newrelic/native-metrics to ^5.1.0.
Upgraded nan to ^2.14.1 to resolve 'GetContents' deprecation warning with Node 14. This version of the native metrics module is tested against Node 14 and includes a pre-built binary download backup for Node 14.
* Added whitespace trimming of license key configuration values.
Previously, when a license key was entered with leading or trailing whitespace, it would be used as-is and result in a validation failure. This most commonly occurred with environment variable based configuration.
* Moved to GitHub actions for CI.
* Updated PR template and added initial issue templates.
* Converted most of the collector API unit tests to use the tap API. Split larger test groupings into their own test files.
### 6.7.1 (2020-05-14):
* Added synthetics headers to transaction event intrinsics for DT
* Fixed stale comment documentation with regards to segment recording
### 6.7.0 (2020-05-06):
* Added a configurable-length span queue to Infinite Tracing:
infinite_tracing.span_events.queue_size.
The queue length can be modified to balance the needs of keeping full traces
against trade-off of memory usage and CPU overhead in a high-throughput
application.
* Fixed issue where API.instrumentLoadedModule could throw an exception when it
failed.
Error details will now be caught and logged.
* Resolved non-proxy minimist security warnings by bumping dependencies.
These updates only impact development dependencies. Thank you to @devfreddy for
the contribution.
* Updated minimist sub-deps to resolve most related security warnings.
* Updated tap to resolve remaining tap security warnings.
* Updated @newrelic/proxy.
* Updated remaining /api unit tests to use tap API.
* Updated @grpc/grpc-js to v1.0.3.
### 6.6.0 (2020-04-20):
* Added support for [Infinite Tracing on New Relic
Edge](https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/enable-configure/enable-distributed-tracing).
Infinite Tracing observes 100% of your distributed traces and provides
visualizations for the most actionable data so you have the examples of errors
and long-running traces so you can better diagnose and troubleshoot your systems.
You configure your agent to send traces to a trace observer in New Relic Edge.
You view your distributed traces through the New Relic’s UI. There is no need to
install a collector on your network.
Infinite Tracing is currently available on a sign-up basis. If you would like to
participate, please contact your sales representative.
* Added `function_version` to lambda metadata payload.
This is pulled from an invocation's `context.functionVersion` value.
### 6.5.0 (2020-03-18):
* Added error attributes to spans.
* The public api method `noticeError()` now attaches exception details to the currently executing
span. Spans with error details are now highlighted red in the Distributed Tracing UI. Also, the
attributes `error.class` and `error.message` are added to the span. If multiple errors are
recorded for a single span, only the final error's attributes will be added to the span.
* Added ID of the span in which an error occurred to the corresponding transaction error event.
* Added new public API methods `addCustomSpanAttribute` and `addCustomSpanAttributes` to add
attributes to the currently executing span.
* Added new attributes to http outbound spans: `http.statusCode` and `http.statusText`.
* Updated W3C Trace Context "Known Issues and Workaround" notes with latest accurate consideration.
* Converted unit tests to run via `tap`. Removes `mocha` dependency.
* Fixed route naming when hapi's `pre` route handlers share functions.
* Fixed `child_process` instrumentation so that handlers can be effectively removed
when attached via `.once()` or manually removed via `removeListener()`.
### 6.4.2 (2020-02-27):
* Support new http[s] get/request function signature in Node v10+
* Added the following Span Event attributes:
- http.statusCode
- http.statusText
The above attributes will be replacing the following *deprecated* attributes:
- httpResponseCode
- response.status
- response.statusMessage
The deprecated attributes will be removed with the next major release of the Agent.
* Updates version check to be in alignment with [our stated support
policy](https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/compatibility-requirements-nodejs-agent)
and the version constraints in package.json
* Redacts individual certificates configuration values before sending to server
settings. When configured, these values will now appear like: `{certificates.0: ****}`.
### 6.4.1 (2020-02-20):
* Bumped `@newrelic/aws-sdk` version to `v1.1.2` from `v1.1.1`.
https://github.com/newrelic/node-newrelic-aws-sdk/blob/master/CHANGELOG.md
Notable improvements include:
* Fixed issue where instrumentation would crash pulling `host` and `port` values
when `AmazonDaxClient` was used as the service for `DocumentClient`.
* Prevented passing CI with `.only()` in mocha tests.
* Removed CI restriction for Node `12.15`. Node shipped a fix for the `12.16`
breakage in `12.16.1`.
* Removed calls to `OutgoingMessage.prototype._headers` in favor of using public
`getHeaders` API (thanks to @adityasabnis for bringing this to our attention).
* Removed engine upper-bound to enable easier experimentation of newer Node versions
with the agent for customers.
Please see https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/compatibility-requirements-nodejs-agent for officially supported versions.
Incompatibilities are expected for odd-numbered releases, which are not supported,
and even-numbered releases before "official" support has been released.
* Reduced "... Aggregator data send." log messages to `debug` level to reduce noise
of default logs.
* Fixed issue where disabled agent would return an empty string instead of an empty
object from API#getLinkingMetadata().
This issue would cause the `@newrelic/winston-enricher` module to crash when
attempting to inject log metadata.
* Reduced logging level of raw `x-queue-start` or `x-request-start` header values
to avoid logging very large values at default logging levels.
### 6.4.0 (2020-02-12):
* Added support for W3C Trace Context, with easy upgrade from New Relic trace
context.
* Distributed Tracing now supports W3C Trace Context headers for HTTP protocols
when distributed tracing is enabled. Our implementation can accept and emit both
the W3C trace header format and the New Relic trace header format. This simplifies
agent upgrades, allowing trace context to be propagated between services with older
and newer releases of New Relic agents. W3C trace header format will always be
accepted and emitted. New Relic trace header format will be accepted, and you can
optionally disable emission of the New Relic trace header format.
* When distributed tracing is enabled with `distributed_tracing.enabled: true`,
the Node agent will now accept W3C's `traceparent` and `tracestate` headers when
calling `TransactionHandle#acceptDistributedTraceHeaders` or automatically via
`http` instrumentation. When calling `Transaction#insertDistributedTraceHeaders`,
or automatically via `http` instrumentation, the Node agent will include the W3C
headers along with the New Relic distributed tracing header, unless the New Relic
trace header format is disabled using `distributed_tracing.exclude_newrelic_header:true`.
* Added `TransactionHandle#acceptDistributedTraceHeaders` API for accepting both
New Relic and W3C TraceContext distributed traces.
Deprecated `TransactionHandle#acceptDistributedTracePayload` which will be removed
in a future major release.
* Added `TransactionHandle#insertDistributedTraceHeaders` API for adding outbound
distributed trace headers. Both W3C TraceContext and New Relic formats will be
included unless `distributed_tracing.exclude_newrelic_header: true`.
Deprecated `TransactionHandle#createDistributedTracePayload` which will be removed
in a future major release.
Known Issues and Workarounds
* If a .NET agent is initiating distributed traces as the root service, you must update
that .NET agent to version `8.24` or later before upgrading your downstream Node
New Relic agents to this agent release.
* Pins Node 12 version to `v12.15` to avoid breakages with `v12.16.0` until cause(s)
resolved.
* AWS Lambda Improvements
* Fixed issue where lambda invocation errors were not noticed in Node 10 or Node 12 environments.
* Added collection of additional AWS Lambda event source meta data.
* Added event type detection for lambda invocation events.
* Expanded ARN harvest to include ALB and CloudWatch.
* Improved Transaction and Trace ID generation.
* Updated publish-docs script to use `npm run` instead of `make`.
### 6.3.0 (2020-01-27):
* Bumped `@newrelic/aws-sdk` to `v1.1.1` from `v1.0.0`.
https://github.com/newrelic/node-newrelic-aws-sdk/blob/master/CHANGELOG.md
Notable improvements include:
* Added official support for API promise calls, fixing two critical bugs.
* Added check before applying instrumentation to avoid breaking for very old
versions.
* Added `bindPromise()` to `Shim` prototype for direct usage by instrumentation.
Previously, `_bindPromise()` was a private function in the `Shim` module.
* Fixed spelling in configuration error.
Thank you to David Ray (@daaray) for the contribution.
* Fixed long-log truncation issue in Serverless mode.
* Updated language in agent to be in line with New Relic Standards.
### 6.2.0 (2019-11-25):
* Upgraded `tap` to resolve `handlebars` audit warnings.
* Added `getLinkingMetadata()` method to the API.
This new method can be used to retrieve the identifying information for the
agent and current active span and trace. Please consult [the documentation](https://docs.newrelic.com/docs/agents/nodejs-agent/api-guides/nodejs-agent-api#getLinkingMetadata)
for more information.
* Added `getTraceMetadata()` to the agent API.
This new method can be used to retrieve the current active Distributed Tracing
span and trace ids. Please consult [the documentation](https://docs.newrelic.com/docs/agents/nodejs-agent/api-guides/nodejs-agent-api#getTraceMetadata)
for more information.
* Added an `isSampled()` method to `Transaction` and `TransactionHandle`.
This new method can be used to retrieve the sampling decision made for a given
transaction. Please consult [the documentation](https://docs.newrelic.com/docs/agents/nodejs-agent/api-guides/nodejs-agent-api#transaction-handle-isSampled)
for more information.
### 6.1.0 (2019-11-05):
* `@newrelic/native-metrics` module is defaulted to disabled in serverless mode.
This can reduce lambda cold-start times by up to 170ms. The `native-metrics` module
can rarely load in serverless environments due to differences from build environment to
deployed environment and offers little value in a serverless environment.
* Added env var `NEW_RELIC_NATIVE_METRICS_ENABLED` to enable/disable the
native-metrics module
* Added a test for querying poolCluster.of()
* Removed unused `mysql` bootstrap test code.
* Increased timeout for `index-bad-version` test to reduce flickers on Node 12.
* Changed file modification to leverage `writeFile` for `watchFile` test. This
triggers the watcher in a reasonable amount of time much more consistently.
* Added `@newrelic/aws-sdk` module to agent for auto-include on install.
* Added splitting of application name using semicolons in the env var.
* Removed testing of Bluebird 3.7 on Node v10 until they fix [the segfault
issue](https://github.com/petkaantonov/bluebird/issues/1618).
* Instrumented `connection.execute` for `mysql2`.
* Added HTTP method to segment attributes for external requests.
* Updated the `bin/ssl.sh` such that it uses verbose output, will exit on first
error code, and will refuse to proceed with LibreSSL (which can't generate certs).
* Added a `clear` sub-command to `bin/ssl.sh` that will allow developers to quickly
remove generated ssl/cert files and regenerate (useful is switch between platforms
via containers/docker and certs needs to be regenerated)
### 6.0.0 (2019-10-29):
* Added official parity support for Node 12.
* Exception: Errors resulting in unhandled rejections will no longer be scoped to the
transaction that was active when the rejected promise was created.
As of node 12, the promise responsible for triggering the init async hook will
no longer be passed through on the promise wrap instance. This breaks the linkage
used to relate a given promise rejection to the transaction it was scheduled in.
* **BREAKING** Removed support for Node 6, 7, and 9.
The minimum supported version is now Node v8. For further information on our
support policy, see:
https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/compatibility-requirements-nodejs-agent.
* Bumped version of `@newrelic/superagent` instrumentation to `v2.0.0`.
* Bumped version of `@newrelic/native-metrics` to `v5.0.0`.
* **BREAKING** Bumped version of `@newrelic/koa` instrumentation to `v3.0.0`
`@newrelic/koa` update includes changes to transaction naming in addition to
dropping Node versions 6, 7, and 9. See `@newrelic/koa`release notes for what was
included in `v2.0.0` and `v3.0.0` updates. https://github.com/newrelic/node-newrelic-koa/blob/master/NEWS.md.
* **BREAKING** `max_samples_stored` behavior has changed to replace
`max_samples_per_minute`. `max_samples_per_minute` is no longer a configuration
parameter.
The new behavior for `max_samples_stored` is as follows: "The agent will collect
all events up to this number per minute. If there are more than that, a statistical
sampling will be collected." This usage of the configuration is consistent with
other agents.
If your application has previously used `max_samples_per_minute` as an upper bound,
you may need to lower the threshold to a valid maximum to avoid data being dropped
on the server. No larger than 10k is recommended.
* Updated utilization callback test to point to a host that can't represent a valid
provider. Previously, location where CI provider runs tests could cause test to
fail.
* Added support for `Promise.allSettled()` method in Bluebird 3.7.
* Bumped `mongodb` dev dependency past security warning.
* Fixed `mongodb` versioned tests so they are self-contained by using version under
test for setup/teardown instead of agent dev-dependency version.
* Forced filename resolution if not already cached on module load. This should not
occur in normal/non-test scenarios but provides a fall-back to maintain
functionality.
* Refactored `restify` versioned tests to be less dependent on the order of asynchronous
operations.
* Updated README to reference Pug rather than Jade.
### 5.13.1 (2019-10-10):
* Added back generation of entity stats logging and uninstrumented support metric
generation on metric harvests.
* Removed legacy harvest code from main agent.
* Updated `https-proxy-agent` to v3 for security fix.
Shoutout to @asturur for the contribution.
* Added diagnostic code injector.
The agent may now be configured to make transaction state checks via code
injection. This may be turned on by setting `code_injector.diagnostics.enabled`
to `true`. While this option is enabled, code around async boundaries will be added
to track transactions, and log a message when they are not properly reinstated.
* Fixed bug where `API.shutdown()` would not properly harvest when configured to.
* `primary_application_id` now defaults to 'Unknown' in serverless mode to allow
Distributed Tracing to function correctly when `NEW_RELIC_PRIMARY_APPLICATION_ID`
is not defined.
* Upgraded `tap` to latest version
* Upgraded `mocha` to latest version.
* Adds `--exit` flag to mocha test runs to prevent infinite runs on CI.
* Fixed bug where multiple agent restarts would cause the number of 'stopped'
listeners to exceed limit.
* Fixed inconsistent async return from collector API.
This could result in an infinite loop due to attempting to merge before clearing.
*This bug should not have impacted normal agent runs but was uncovered for certain
test cases.*
* Fixed tests that leave work scheduled on the event loop.
* Fixed issue that could result in vendor utilization detection failure.
As a part of this fix, the request that hits the timeout will immediately abort
instead of hanging around for the default timeout.
### 5.13.0 (2019-10-01):
* Same as 5.12.0
### 5.12.0 (2019-10-01):
* Now supports Restify 7 and 8.
* Distributed Tracing is now enabled by default in serverless mode.
* Maximum event limits are now enforced by the server. This includes
a new maximum of 10000 transaction events per minute.
* Harvesting is now completed by individually scheduled harvesters per data type.
* Bumps tap version to move beyond handlebars audit warning.
* Bumps `restify` dev dependency past audit warning.
* HTTPS connections to New Relic now use a keep alive HTTP-Agent.
* Drops old odd-numbered node versions that are no longer supported by node from
travis testing.
* Fixed bug where segment reference on the outbound request was enumerable.
* Fixed bug where incorrect config information was sent to New Relic.
* Updated Mocha and Docker links in CONTRIBUTING.md.
* The agent will now end/serialize transactions in the event of an uncaught
exception while operating in serverless mode.
### 5.11.0 (2019-07-29):
* Implements Expected and Ignored Errors functionality
* Bumps jsdoc and lodash dev dependency to avoid upstream vulnerability warning.
* Added support for scoped package name introduced in hapi v18 (@hapi/hapi).
This will provide functionality at parity with instrumentation for hapi v17. Any
new features may not yet be supported.
Huge shoutout to Aori Nevo (@aorinevo) for this contribution.
* Fixed bug where agent would count errors towards error metrics even if they were
dropped due to the error collector being disabled.
* The agent will now properly track cached paths to files in loaded modules on Node
versions >10.
As of Node v11, the path to a file in a module being loaded will only be resolved
on the first load; subsequent resolution of that file will use a cached value.
The agent records this resolved path and uses it for relative file look ups in
order to deep link into modules using `Shim#require`. Since the agent couldn't
reliably get at the path on the subsequent calls to require, it now replicates
the caching logic and hold onto the resolved path for a given file.
* Adds detailed logging through harvest/collector code to increase supportability.
### 5.10.0 (2019-06-11):
* The agent now allows installation on node v11 and v12.
This change relaxes the engines restriction to include Node v11 and v12. This does
not constitute official support for those versions, and users on those versions
may run into subtle incompatibilities. For those users who are interested in
experimenting with the agent on v11 and v12, we are tracking relevant issues
here: https://github.com/newrelic/node-newrelic/issues/279.
* Lambda invocations ended with promises will now be recorded properly.
Previously, the lambda instrumentation was not intercepting the promise
resolution/rejection returned from a lambda handler. The instrumentation now
properly observes the promise, and ends the transaction when the promise has
finished.
* Lambda invocations will only attempt to end the related transaction a single time.
In the event of two lambda response events (e.g. callback called, and a promise
returned), the agent would attempt to end the transaction twice, producing an
extraneous empty payload. The agent now limits itself to a single end call for
a given transaction.
* The agent will now properly end transactions in the face of uncaught exceptions
while in serverless mode.
* Enables ability to migrate to Configurable Security Policies (CSP) on a per agent
basis for accounts already using High Security Mode (HSM).
When both HSM and CSP are enabled for an account, an agent (this version or later)
can successfully connect with either `high_security: true` or the appropriate
`security_policies_token` configured. `high_security` has been added as part of
the preconnect payload.
### 5.9.1 (2019-05-28):
* moved third party notices to `THIRD_PARTY_NOTICES.md`
* Shim#require will now operate as expected.
Previously, the module interception code made the faulty assumption that a module's
filepath would be resolved before the module load call was invoked. This caused
the wrap filepath to be attributed to the modules being instrumented. This meant
that attempted relative require calls using Shim#require would resolved from the
incorrect path. The logic has been changed to keep a stack of the resolved
filepaths, resolving the issue.
* Updates error message for license check to indicate all places that need to be
updated.
* Shim#wrapReturn now uses ES6 proxies to wrap its methods.
This will accurately propagate look up and assignment onto the underlying wrapped
function, while maintaining all previous functionality.
* Updated versioned test configurations to reflect current engine support.
### 5.9.0 (2019-05-20):
* Removed older versions of Cassandra from versioned tests
* For debug/test runs, shimmer will now cleanup the __NR_shim property on
instrumented methods. This leftover property did not result in any negative
behaviors but cleaning up for thoroughness and to prevent potential confusion.
* `serverless_mode` feature flag is now enabled by default.
* Fixes `recordMiddleware` promise parenting for certain cases where child segments
are created within resolving middleware `next()` promises.
* Added `instrumentLoadedModule` function to the API, allowing end-users to manually
apply an instrumentation to a loaded module. Useful for cases where some module
needs to be loaded before newrelic
### 5.8.0 (2019-05-06):
* Modifies `MiddlewareSpec` route property to allow functions. Defers route
processing and segment naming until just before needed (each middleware
invocation).
* Fixed outdated `license` ref in `package.json`.
* Middleware instrumentation now honors `spec.appendPath` for more cases and will
not pop paths when it has not appended a path.
### 5.7.0 (2019-04-24):
* Added `getStatusName` to `NameState`.
Now web transactions will be named after known status code messages (404, 405,
and 501).
* Broke apart `integration` script test globs.
* Added `appendPath` option to MiddlewareSpec.
### 5.6.4 (2019-04-16):
* Refactored config to log warning and disable distributed tracing if enabled in
serverless mode, but missing required config setting.
* Serverless mode no longer sets different data collection limits.
* The agent will no longer crash the process in the event of unexpected calls to
the harvest callback.
* Updated required config values when using distributed tracing in `serverless_mode`
to only include `account_id`.
### 5.6.3 (2019-04-01):
* The agent will now accurately filter out request parameters while operating under
CSP or HSM.
You can find more information about this change here:
https://docs.newrelic.com/docs/using-new-relic/new-relic-security/security-bulletins/security-bulletin-nr19-02
### 5.6.2 (2019-03-25):
* Agent now respects attribute type restrictions on trace/segment attributes, as
well as error event/trace attributes.
* Fixes potential for `RangeError: Maximum call stack size exceeded` error on
Transaction/Trace end.
* Custom events no longer accept attributes with invalid types.
The only attribute types accepted by the backend are `boolean`, `string`, and
`number`; any attribute assigned to a custom event outside these types would be
dropped on ingest. The agent now filters these attributes out, and logs out a
helpful message detailing the issue.
### 5.6.1 (2019-03-11):
* Updated log message for not adding attributes and change the log level to debug.
* Fixed an issue where exclusive time would be improperly calculated in some cases.
### 5.6.0 (2019-03-04):
* Added `product` attribute to existing datastore instrumentations.
* Added `db.collection` to datastore span event attributes.
* `trusted_account_key`, `account_id`, and `primary_application_id` may now be
configured via a configuration file while in serverless mode.
* Fixed a bug where data belonging to distributed traces starting in the Node.js
agent would be prioritized over data produced from traces starting in other
language agents.
Previously, the agent would use the same random number for both the transaction
priority (used for data sampling) and the Distributed Tracing trace sampling
decision (whether to create DT data for a given transaction). This random number
reuse resulted in a bias that caused data from distributed traces started in the
Node.js agent to be prioritized above data that belongs to distributed traces
started in other language agents. The agent now makes individual rolls for each
of these quantities (i.e. the transaction priority and trace sampling decision),
eliminating the bias.
* Optimized exclusive time duration calculator.
Previously, the agent would spend a lot of time sorting redundant arrays while
calculating the exclusive time for the segments of a trace. This has been
refactored into a single postorder traversal over the tree which will calculate
the exclusive time for all segments in the subtree rooted at a given segment.
* Prevent a split on undefined location under certain conditions in Memcached.
Special thanks to Ben Wolfe (@bwolfe) for this fix!
### 5.4.0 (2019-02-19):
* Fixed issue where `shim.createSegment()` could result in modifying the parent
when opaque.
* Fixed issue where `http-outbound` would modify parent segments when parent is
opaque.
* Moved processing of exclusive time attribute out of `toJSON` and into `finalize`
to only be calculated once.
Previously, serializing a segment would result in calculating and caching exclusive
time which could result in issues if serialized prior to ending.
* Added `SNS` to message shim library names.
* Added check for `collect_span_events` in config sent from the server on connect.
Collection of span events can be disabled from the server configuration, but not
enabled.
* Refactored `Segment#toJSON` to be more readable.
* Added a `try/catch` to config initialization to safely handle invalid setting
combinations.
When an error is caught the agent is marked as disabled, which ultimately returns
a stub API and keeps the process running.
* String truncation is now done using a binary search over the byte length of the
string.
Previously this truncation was done using a linear search for the proper byte
length.
* Optimized segment and span attribute filtering.
### 5.3.0 (2019-02-12):
* Added `span_events` and `transaction_segments` attribute destinations.
Span event and segment attributes can now be filtered using the same
include/exclude config rules as other types. See [agent attribute
configuration](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#node-js-attributes)
for more details.
* Added `metadata` field to connect payload, for collecting
`NEW_RELIC_METADATA_`-prefixed environment variables.
* Added DynamoDB to datastores.
* Added `opaque` option to datastore operation spec.
* Added Kubernetes utilization detection.
* Upgraded `concat-stream` and `readable-stream` to next major version.
These modules had previously been held back due to support for Node <6. Since
v5.0.0 we dropped that support thus enabling these updates.
* Added SQS as a supported messaging library name.
* Fixed opaque segment functionality for `message-shim.recordProduce`.
* Fixed opaque segment functionality for `message-shim.recordConsume`.
* Enabled tracking of callback via `message-shim.recordConsume` when no
messageHandler provided.
* Replaced `make` rules with npm scripts.
* The agent will now consistently harvest in all response cases when in serverless
mode.
Previously, the agent's harvest was in a race with process suspension in the event
of an uncaught exception, or responding without calling a callback. A synchronous
harvesting process is now used to circumvent this racing issue.
* Fixed issue with socket connection errors causing the agent to stop attempting
to connect at startup.
### 5.2.1 (2019-01-28):
* Fixed bug where agent would stop sending data to New Relic servers wh