Node.js Agent Release Notes

Node.js Agent Release Notes

Monday, May 20, 2019 - 15:30 Download

New Features

  • serverless_mode feature flag is now enabled by default.

  • Added instrumentLoadedModule method 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

Improvements

  • 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.

  • Fixes recordMiddleware promise parenting for certain cases where child segments are created within resolving middleware next() promises.

Monday, May 6, 2019 - 15:30 Download

New Features

  • Modifies MiddlewareSpec route property to allow functions. Defers route processing and segment naming until just before needed (each middleware invocation).

Improvements

  • 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.

Wednesday, April 24, 2019 - 16:00 Download

New Features

  • Added getStatusName to NameState.

    Now web transactions will be named after known status code messages (404, 405, and 501).

  • Added appendPath option to MiddlewareSpec.

Improvements

  • Broke apart integration script test globs.
Tuesday, April 23, 2019 - 13:16

Fixes

  • Fixed bug where agent would stop sending data to New Relic servers when a connectivity issue was encountered.

  • The agent will no longer crash the process in the event of unexpected calls to the harvest callback.

Tuesday, April 16, 2019 - 13:00 Download

Bug fixes

  • 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.

Monday, April 1, 2019 - 09:47 Download

Bug fixes

  • The agent will now accurately filter out request parameters while operating under CSP or HSM.

    You can find more information about this change in the Security Bulletin.

Monday, March 25, 2019 - 14:19 Download

Improvements

  • Agent now respects attribute type restrictions on trace/segment attributes, as well as error event/trace attributes.

Bug fixes

  • 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.

Monday, March 11, 2019 - 14:20

Fixes

  • 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.

Monday, March 4, 2019 - 11:40

New features

  • Added product attribute to existing datastore instrumentations.

  • Added db.collection to datastore span event attributes.

Improvements

  • trusted_account_key, account_id, and primary_application_id may now be configured via a configuration file while in serverless mode.

  • 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.

Fixes

  • 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.

  • Prevent a split on undefined location under certain conditions in Memcached.

Tuesday, February 19, 2019 - 12:52

New features

  • 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.

Improvements

  • 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.

Fixes

  • 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.

Monday, February 11, 2019 - 16:26

New features

  • 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 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.

  • Enabled tracking of callback via message-shim.recordConsume when no messageHandler provided.

Improvements

  • Replaced make rules with npm scripts.

Bug fixes

  • 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.

  • Fixed opaque segment functionality for message-shim.recordProduce.

  • Fixed opaque segment functionality for message-shim.recordConsume.

Tuesday, January 29, 2019 - 10:26 Download

Improvements

  • Removed installation of Oracle container test scripts.

  • Replaced explicit config.high_security === true checks with general truthiness checks.

    The agent will now treat any truthy value in the high_security config setting as if it is enabled.

Bug fixes

  • Fixed bug where agent would stop sending data to New Relic servers when a connectivity issue was encountered.

  • Fixed unit test with incorrect usage of cross application tracing.

Wednesday, January 23, 2019 - 11:11 Download

New features

  • Added Neptune to the known database names.

Improvements

  • Updated log messages for missing configuration files to point at the base configuration.

    Previously the log messages pointed at an internal file defining default values for every configuration.

  • Upgraded to @newrelic/native-metrics v4.

  • Removed outdated config files.

  • Removed old, outdated examples.

Bug fixes

  • Fixed an issue where old CAT headers would be injected while distributed tracing was enabled.

    This would happen if both cross_application_tracing.enabled and distributed_tracing.enabled were set to true and an instrumentation disabled tracing for an outbound request.

  • Fixed access to ConglomerateShim in shimmer.

Thursday, January 17, 2019 - 10:32 Download

New features

  • Added new shim type: ConglomerateShim

    This shim class is useful for instrumenting modules which implement several service interfaces of different types.

Improvements

  • Disabled logging by default when serverless_mode is enabled. Please note serverless/lambda monitoring is not yet officially released.

  • null trace attribute values are no longer sent to New Relic.

    This change brings the Node agent in alignment with the behavior of other language agents.

Tuesday, January 8, 2019 - 14:46

Notes

  • Dropped support for Node versions less than 6.

  • Agent no longer creates transactions when in a stopped, stopping or errored state.

  • Removed public API methods that have been deprecated since Agent v2: createTracer, createWebTransaction, createBackgroundTransaction, and addCustomParameter/(s). See the Migration Guide for more information.

  • Flagged API#setIgnoreTransaction as deprecated; TransactionHandle#ignore should be used instead.

  • Released several feature flags. These flags are no longer used:

    • feature_flag.custom_instrumentation
    • feature_flag.custom_metrics
    • feature_flag.synthetics
    • feature_flag.native_metrics
  • Added plugins.native_metrics.enabled configuration value.

    This configuration value controls the use of the @newrelic/native-metrics module. When set to false the agent will not attempt to load that module.

  • Custom metrics recorded via recordMetric and incrementMetric API calls now automatically have the name prepended with 'Custom/'. Usages of these APIs that manually prepend with 'Custom/' will need to remove the manually specified one or will end up with metrics prepended with 'Custom/Custom/'.

  • Dropped support for node-cassandra-cql.

  • Removed from ignore_server_configuration config setting.

  • Removed deprecated configuration settings capture_params and ignored_params.

https://source.datanerd.us/NodeJS-agent/nodejs_agent/pull/1656

  • The agent will no longer cause a stack overflow when logging at trace level to stdout.

    Previously, the agent would inadvertently trigger a trace level log from its trace level log (through wrapping a nextTick call), causing a stack overflow. The agent now detects this case and aborts the nested call.

Thursday, December 20, 2018 - 12:30 Download

New features

  • The agent now reacts to failed New Relic requests based on response code, as opposed to parsing an exception message in the response body.

Improvements

  • Fixed clearing of active harvest via _stopHarvester()

  • Fixed handling of harvest endpoints when not all fail.

  • Added agent state "connecting" to indicate when handshake with New Relic servers is starting. This can be triggered on startup and restarts.

  • Added --no-package-lock to unit and integration rules.

  • Released protocol_17 feature flag.

  • Replaced nsp with npm audit in security checks.

  • Collector now specify application/json content-type when data is compressed instead of octet-stream.

  • Bumped ecmaVersion in test .eslintrc to 8

Monday, December 3, 2018 - 10:59 Download

New features

  • Added IP address collection and forwarding of metadata headers for upcoming protocol 17.

    These features are currently behind the protocol_17 feature flag until all parts of protocol 17 are implemented.

Improvements

  • Converted error handling in CollectorAPI and RemoteMethod to callbacks.

    Previously many of the errors were thrown. For consistency with async errors, these are now handed to the callback instead of thrown. The old behavior could result in a crash under a few circumstances, such as when the agent exceeded a configured maximum payload size. These errors came from RemoteMethod._safeRequest. Since these errors are handed to the callback instead of thrown, this bug is no longer a potential.

  • Refactored harvest interactions in preparation for protocol 17 status codes.

Thursday, November 15, 2018 - 12:10 Download

New features

  • Added protocol_17 feature flag.

    Flag will be removed and protocol will be hard-coded to 17 once functionality is released on New Relic backend.

  • This release also includes changes to the agent to enable monitoring of Lambda functions. If you are interested in learning more or previewing New Relic Lambda monitoring please email lambda_preview@newrelic.com.

  • Added waitForIdle option to API#shutdown.

    This new option will make the agent wait for all active transactions to finish before actually shutting down. This does not pre-empt creation of new transactions, so care must be taken to ensure the active transaction pool drains or the agent will never shut down.

Improvements

  • Added switch statement indenting standard to eslintrc

  • Introduced "warn" level 2 space rule to eslintrc

  • Upgraded @newrelic/test-utilities to v2.

Bug fixes

  • Changed totalTime attribute to be in decimal seconds instead of milliseconds for transaction events.

  • Agent no longer produces spans on ignored transactions.

    Previously, the agent would produce distributed tracing span events regardless of the ignored status of the transaction the events originated from.

  • Extended Restify instrumentation to mark possible transaction names in order to account for async response methods.

  • Updated hapi@16 versioned tests to only run on Node 6 and above.

  • Pinned mysql2 to <1.6.2 in versioned tests.

Thursday, November 1, 2018 - 14:06 Download

New features

  • Added DatastoreShim#getDatabaseNameFromUseQuery

    This new method can be used to extract the database name from USE SQL queries.

Improvements

  • Added link to CONTRIBUTING.md file in README.md

    Thanks to Yuri Tkachenko (@tamtamchik) for the contribution.

  • Added VS Code settings to git ignore.

  • Fixed bug preventing Distributed Tracing (DT) from fully functioning when Cross Application Tracing (CAT) was disabled.

  • Renames better-cat integration test organization to be distributed-tracing and updated some test verbiage to use DT or distributed tracing instead of CAT or cross application tracing.

Bug fixes

  • The agent will no longer break express routers in the case of using regex paths in a list.

    Previously, the agent would overwrite the regex with the source of the regex. The agent now makes a copy of the route array and mutates that instead.

  • Attributes will now be properly propagated to PageView events.

    The agent may now be configured to pass attributes along to the browser agent. The attributes that match the include/exclude rules in the browser_monitor.attributes section will now be placed on PageView events.

Monday, October 1, 2018 - 11:16 Download

New features

  • Added superagent as built-in instrumentation.

    This instrumentation just maintains transaction state when using the superagent module to make HTTP requests with either callbacks or promises.

  • Updated noticeError API method to be partially functional in High Security Mode.

    In HSM, any custom attributes will be ignored, but the error will still be tracked. This brings the Node agent in line with the behavior of other language agents.

  • Added PromiseShim class for instrumenting promise libraries.

  • Support for setting transaction_tracer.transaction_threshold to 0 has been added.

Improvements

  • Updated DT payload creation to use primary_application_id from connect response.

  • Added protection against functions with modified prototypes in shim.applySegment.

  • Replaced SQL ID hash generation algorithm with SHA1 instead of MD5 to allow usage in FIPS compliant environments.

  • Leveraged 16 hex digits for creation of SQL ID.

  • Upgraded ejs module to get rid of Github security warnings. The ejs module was only used for tests and not in main agent code.

  • Changes DT payload configuration log messages to debug level as it is not uncommon for calls to occur before server configuration has been retrieved.

  • Converted net instrumentation to use shim api.

  • Converted child_process instrumentation to newer shim style.

  • Converted Timers instrumentation to newer shim style.

  • Converted zlib instrumentation to use shim API.

Bug fixes

  • Fixed codec.decode() callback bug that would re-call a callback with an error thrown within the callback.

  • Fixed bug requiring Cross Application Tracing (CAT) to be enabled for Distributed Tracing (DT) createDistributedTracePayload and acceptDistributedTracePayload APIs to function. DT configuration will no longer consider CAT configuration.

  • Fixed bug in wrap() that would fail to wrap callbacks if the callback index was 0.

  • The agent now respects NEW_RELIC_TRACER_THRESHOLD.

    Previously, this environment variable was stored as a string. The environment variable is now stored as a float.

Pages