The NodeJS agent only covers applications launched by the commands : ”> node index.js”, ”> keystone index.js”, etc… .
To monitor NodeJS applications, Nudge APM provides a probe composed of two integrated elements:
- The NodeJS Native Profiler (inspector), available natively when nodeJS is installed on the client workstation.
- The OpenTelemetry, which captures information on requests sent or received to or from the client server.
The NodeJS probe merges the metrics received by the two entities Profiler and OpenTelemetry and sends them to the Nudge APM portal.

There are four steps to installing a probe on a NodeJS application:
- Application declaration in the Nudge APM interface
- Agent installation on the Windows/Linux server
- Agent configuration by modifying the configurationAgentNodeJS.ini file in its root folder.
- Checks
Application declaration
-
From the Nudge APM main dashboard, click on the New application button.

-
Select the type of application environment and accept the terms and conditions.

-
Enter the characteristics of your application, taking care to select the type of application: NodeJS

Install NodeJS Agent
The 3 installation files contain a token that allows you to download and install all packages, including OpenTelemetry, dedicated to the NodeJS agent.
⚠️ Note -> Under docker, the following lines are required for the token to be taken into account during package installation by > npm i
RUN apt install -y git
RUN apt install -y util-linux
RUN apt install -y make gcc g++ python3
RUN git config –global url.”https://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@github.com/”.insteadOf “ssh://git@github.com/”
RUN npm install
NodeJS Agent configuration
-
Configure the NodeJS Agent using the configurationAgentNodeJS.ini file.
⚠️Retrieve the application key supplied by NUDGE when it was declared in the GUI, and paste its value into the [Nudge]app_id field.
⚠️The url for directing metrics to the NUDGE collector must be set to [Nudge]url.
⚠️The path from url to NUDGE in [Nudge]pathCollect field

- It is possible to modify the name of unknown classes and functions by default for profiler display, as well as the prefix of the session name that will be added in the “Service” tab, “Name” column.

- [Profiler]profilerSamplingInterval Interval between 2 stack samples in µs: 1000 => 1 KHz, 10000 => 100 Hz.
- [NodeJS]refreshLoadCPU CPU load calculation period.
- [NodeJS]filterHeader lists the names of the headers to be retrieved in an array. If the array is empty, all request headers (OpenTelemetry) are retrieved.
- [Drives]refreshScanDrives period between each disk metric measurement in minutes.
- [NodeJS]sendUserConnectionString adds the user to the Connection String of a database. This information will be visible in the MAP tab of Nudge. To be checked by the client if this leads to security problems.
- [NodeJS]stackTraceLimit maximum number of lines that the stack JavaScript can send to the Nudge collector.
- Other fields are present whose usefulness is oriented towards “functionality testing and agent fine-tuning “ pre-configured for optimum operation, such as:
- [NodeJS]openttelemetry which allows you to disable (false) or enable (true) OpenTelemetry.
- [NodeJS]profilerV8 to disable (false) or enable (true) the CPU-intensive profilerV8. Useful if only the tracing of query calls is required, it frees up CPU load and allows OpenTelemetry to trace faster.
- [NodeJS]recordProfiler allows you to save JSON files, raw data from the profilerV8, to disk.
- [NodeJS]recordCollecte allows you to save JSON files of raw OpenTelemetry data to disk.
- ⚠️ (Do not modify - false) [NodeJS]exposeGC interferes with the NodeJS Garbage Collector (not the same as the CLR for .NET).
- ⚠️ (Do not modify - true) [NodeJS]waitEndService waits for the OpenTelemetry closure of a service call (traceId) before sending it to the Nudge collector.
- ⚠️ (Do not modify - true) [Profiler]pointEntreeClientOnly returns to Nudge only the child stack of a service call.
- ⚠️ (Do not modify - 5000) [Profiler]refreshStopStartRecycling minimum period between each profilerV8 block to be merged with a OpenTelemetry customer service call.
- ⚠️ (Do not modify - false) [Console] displays information in the console.
- ⚠️ (Do not modify - comment) [Nudge]sessionId agent NodeJS startup session identifier.
- ⚠️ (Do not modify - 3600) [NodeJS]timeoutBufferTransaction time to retain the OpenTelemetry data of a traceId (transaction) before sending it to the Nudge collector.
- ⚠️ (Do not modify - 1000) [NodeJS]bufferSizeSpan number of Span (cf OpenTelemetry) retained for next agent version.
Vérifications
- If you launch your application this way node “./server.js “
- Add the agent entry point like this -r “[.NodeJS agent path]/Agent_Nudge.js” to your application startup script.
- Use the “-require “ or “-r “ flag to inject the NodeJS agent as follows: node -r “[.path to NodeJS agent]/Agent_Nudge.js” “./server.js”.
-
If your application launches without typing “node”, such as “keystone”, which does not include an injection switch. You can still inject agent NodeJS by inserting the following line in your application’s entry point file.
require(“[.path of NodeJS agent]/Agent_Nudge.js”);
If you encounter any difficulties during installation, please do not hesitate to contact us: support@atakama-technologies.com