Skip to main content

Overview

Motadata APM supports NodeJS trace ingestion using OTEL and its custom agent. NodeJS applications must run on supported versions (^18.19.0, 20.6.0 or higher), and trace ingestion is agent-based with runtime instrumentation.

Prerequisites

  • The Motadata Agent must be installed and running on the Linux server where the NodeJS application is deployed.
  • otelcol must also be running as part of the Motadata Agent.

Check agent status:

service motadata status

If the agent is not running:

service motadata stop
service motadata start
  • NodeJS version must be ^18.19.0, 20.6.0 or higher

To verify the NodeJS version use the below command:

node -v

Go to Menu > Settings > APM > Application Registration.
Clicking the Application Registration button, you can register a new application. From the application registration screen, select the instrumentation type Host/VM or Docker.

NodeJS Trace Configuration

FieldDescription
Select AgentSelect the Host/VM where this application is running. You can configure NodeJS application service for both Windows and Linux type agent.
LanguageSelect NodeJS from the language icons.
Business ServiceThe business service represents a logical grouping of related microservices under a single business application (e.g., Order Management). Adding or selecting the available service group from the drop-down will add your application service to the dedicated business service group.
Service NameProvide a unique and meaningful name (e.g., payment_gateway).
Service Attributes (Tags)Add key–value tags to your application for better filtering and organizing data in Explorer. Attribute key names must be lowercase (for example, apm.env = prod). To add multiple Key-Value pairs, click the add icon.
Add Custom ParametersAllows you to define custom sampling or tagging parameters for advanced use cases. These optional parameters are passed to the agent (for example, version=4).

Clicking the Apply Configuration button, the ingestion gets started.

Providing these details displays the Setup Command to instrument your NodeJS application. Run the generated script from the project’s root directory and restart the service to start collecting Traces.

You can configure Trace ingestion according to the framework used to build the application.
The below mentioned are the supported frameworks.

Supported Framework

The following frameworks are supported for instrumentation and monitoring. Ensure your application version aligns with the supported versions listed below.

FrameworkVersion(s)
connect≥ 3.0.0 < 4
express≥ 4.0.0 < 5
graphql≥ 14.0.0 < 17
hapi≥ 17.0.0 < 22
koa≥ 2.0.0 < 3
koa/router≥ 8.0.0
nestjs-core≥ 4.0.0 < 12
restify≥ 4.1.0 < 12

Supported Database

DatabaseVersion(s)
cassandra-driver>= 4.4.0 < 5
knex>= 0.10.0 < 4
mongodb>= 3.3.0 < 7
mongoose>= 5.9.7 < 9
mysql>= 2.0.0 < 3
mysql2>= 1.4.2 < 4
oracledb>= 6.7.0 < 7
pgpg (>= 8.0.3 < 9), pg-pool (>= 2.0.0 < 4)

Supported Queue

QueueVersion(s)
amqplib>= 0.5.5 < 1
ioredis>= 2.0.0 < 6
kafkajs>= 0.3.0 < 3
redis>= 2.6.0 < 5

Supported Others

LibraryVersion(s)
aws-lambdaVersion-agnostic
aws-sdk>= 3.0.0 < 4
bunyan>= 1.0.0 < 2
cucumber>= 8.0.0 < 11
dataloader>= 2.0.0 < 3
dnsbuilt-in module
generic-pool>= 2.0.0 < 4
grpc>= 1.0.0 < 2
httpbuilt-in module
lru-memoizer>= 1.3.0 < 3
memcached>= 2.2.0 < 3
netbuilt-in module
pino>= 5.14.0 < 10
runtime-nodebuilt-in module
socket.io>= 2.0.0 < 5
undici>= 5.12.0
winston>= 1.0.0 < 4

Once the Application is Running, you need to verify the below points:

  • Confirm that the service has been registered successfully.
  • On the service registration screen, the Service Trace Collection Status should display "Running."
  • The traces will start appearing in the APM Explorer screen.