Node.js
Node.js is a server-side framework based on the V8 JavaScript engine by Google. Node.js has an asynchronous execution model and is frequently used for gluing or as a proxy tier within enterprise environments.
Capabilities
Dynatrace provides extensive Node.js monitoring capabilities:
- Heap and process metrics
- Heap dumps
- CPU sampling
- Event loop metrics
- Insights into inbound and outbound HTTP calls
- Dedicated support for a variety of databases (includes query capture)
- OpenTelemetry support for capturing traces and ingesting metrics.
For more information, see Instrument your JavaScript application on Node.js with OpenTelemetry - OneAgent SDK for custom tracing
- Continuous thread analysis for worker threads
See our supported technologies matrix for details about supported technologies that will be used in conjunction with Node.js.
Support & desupport
Node.js follows an LTS release model.
Each odd-numbered version reaches EOL shortly after each new even-numbered version is released. Each even-numbered version eventually becomes an LTS release. For enterprise production environments, we recommend that you stick to LTS releases.
Whenever a new Node.js major version (even or uneven) is released, we add support for that version.
Dynatrace will follow this support model, but will support each Node.js version at least half a year longer to give our customers time for upgrades.
Continuous thread analysis for worker threads
Node.js version 12+ OneAgent version 1.251+ Dynatrace version 1.256+
Continuous thread analysis for worker threads can automatically identify CPU-intensive threads and pinpoint scalability issues when work is distributed across many threads so that you can solve performance bottlenecks before your end users are impacted.
Statistics about the main
and worker
threads:
CPU time consumed by the various worker
threads:
To get started with the continuous thread analysis for worker threads, activate the OneAgent features Node.js worker threads monitoring and Node.js code module preloading.
Node.js specific metrics (for example, memory, garbage collection, and event-loops) are only reported for the main
thread.
Class browsing (required for the custom messaging services of kafkajs) is limited to the main
thread.
There is no automatic transaction tracing in place between the main
and worker
threads. For tracing transactions across threads, you can either use OpenTelemetry tracing or the OneAgent SDK.
Known limitations
-
Due to platform limitations of JavaScript and Node.js, code-level visibility is limited compared to .NET or Java.
-
In conjunction with unsupported third-party modules, context can be lost in asynchronous callbacks. In such cases, please contact a Dynatrace product expert via live chat within your Dynatrace environment.
-
OneAgent version 1.279+ CPU times are not reported for Node.js services. These numbers were misleading, since by design a major part of any operation is handled asynchronously inside the Node.js runtime without the possibility to correlate the actual CPU time to a specific service.
-
Using the NPM module esm in variant 1 for packages might result in reduced visibility (especially if used for the main application script). It's preferable to use variant 2 to preload
esm
via the-r
command line option. -
There is currently only limited support for ECMAScript modules (aka "ES6 modules"):
-
If the main script file itself is an ECMAScript module OneAgent version 1.219+ with Agent preloading enabled is needed for the OneAgent to be injected into the Node.js process.
-
Instrumentation of ECMAScript modules is currently not available. This limits support for
kafkajs
in case the user defined entrypoint for the KafkaJs sensor is inside an ECMAScript module.
-
-
Webpack bundles all modules into a single file by default. OneAgent is unable to instrument bundled modules. To work around this limitation, all modules that need to be instrumented by OneAgent (such as
express
,mongodb
, andpg
) need to be externalized in the webpack configuration. For details, see the webpack externals documentation. -
Using Webpack or other bundlers might also have an impact on automatic vulnerability detection. This is because the software components cannot be detected, as they are hidden behind the bundler configuration and not available at runtime. Only packages that are deployed as external packages can be detected and reported.