github DataDog/dd-trace-js v0.27.0
0.27.0

latest releases: v5.14.0, v4.38.0, v5.13.0...
3 years ago

This release is focused mostly on performance where we did several improvements:

  • The default scope manager is now based on AsyncLocalStorage instead of init and destroy hooks using async_hooks. This should make the tracer several times faster when used with Node ^12.19 || >=14.5 in promise-heavy applications.
  • We removed debug metrics when using runtime metrics unless debug mode is enabled. This should help performance in applications that generate a lot of spans, are promise-heavy, or receive a lot of traffic.
  • A new encoder that is based on notepack instead of msgpack-lite which is faster and also fixes a regression that significantly increased CPU usage in some cases. To try the new agent endpoint version that de-duplicates strings using a string table which is a lot more efficient for high load applications, make sure to upgrade the agent to >=7.23 and to use the DD_TRACE_AGENT_PROTOCOL_VERSION=0.5 option on the tracer.

Breaking Changes

The runtime.node.spans.* and runtime.node.async.resources.* metrics have been removed by default. Both sets of metrics proved too expensive, and were generally not that useful except for debugging issues with the tracer. The runtime.node.spans.* metrics are still enabled in debug mode, but the runtime.node.async.resources.* can no longer be captured with the new AsyncLocalStorage based scope manager. While they are still available with the async_hooks based scope manager, they rely on a destroy hook to be collected, which is extremely expensive and thus we recommend to keep the default. This is also why we made the AsyncLocalStorage scope manager the default in this version.

Bug Fixes

  • core: fix performance regression in the agent exporter (#1119)
  • core: fix logging of dropped traces not including the trace (#1105)
  • core: fix error in debug mode when using an indirectly instrumented logger (#1102)
  • docs: fix missing TypeScript definition for the AsyncLocalStorage scope manager. (#1089), thanks @blimmer!
  • graphql: fix graphql resolve span duration not accounting for wall time (#1109)
  • mysql: fix missing fields when using the tracer (#1116), fixes #1113

Features

  • profiler: fix performance issue with the profiler and re-introduce as experimental (#1098)

Improvements

  • core: update the scope manager to default to AsyncLocalStorage on versions of Node that support it (#1086)
  • core: optimize span creation (#1108)
  • core: disable debug metrics by default (#1104)
  • core: fix traces no longer reporting because of agent upgrade/downgrade by using a fixed endpoint version by default (#1107)
  • core: avoid C++ calls in some hot paths (#1100)
  • pg: add support for changing the service name based on connection params (#1110), closes #977

Don't miss a new dd-trace-js release

NewReleases is sending notifications on new releases.