Table Of ContentAPM for Node.js
AppDynamics Pro Documentation
Version 4.0.x
Page 1
APM for Node.js . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Monitor Node.js Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Monitor Node.js Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
View Process Snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Node.js Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Process Snapshots and Business Transaction Snapshots . . . . . . . . . . . . . . . . . . . . 11
Configure Transaction Detection for Node.js . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Configure Node.js Web Transaction Naming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Configure Node.js Custom Match and Exclude Rules . . . . . . . . . . . . . . . . . . . . . . . . 16
Resolve AppDynamics Issues for Node.js . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Node.js Agent API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Node.js Agent API Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Node.js Agent API User Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Page 2
APM for Node.js
Once your Node.js application environment is instrumented with the AppDynamics Node.js Agent,
you can start monitoring application performance. For general information on configuring
AppDynamics deployment, see the topics under AppDynamics Essentials.
This section describes considerations specific for monitoring Node.js processes. It also describes
how to fine tune the Node.js Agent configuration for transaction detection.
Get a PDF version of the documentation.
Learn by watching
Application Intelligence with
End-to-end APM What's New in Node.js Monitoring in
AppDynamics: A Quick Tour
for Node.js 4.0?
More videos...
Install a Controller or cross application correlation
get a SaaS Controller call graphs in business transaction
Instrument Node.js snapshots
Applications socket.io metrics and event loop metrics
Monitor Node.js Node.js Agent API for creating custom
Applications business transactions and custom exit
Monitor Node.js points
Processes support for Node.js version 0.10.33
Configure
Transaction Detection
for Node.js
Node.js Supported
Environments
Monitor Node.js Applications
On this page:
Node.js Agent
Dashboard
Business Transactions
Processes
Backends
Customizations
Related pages:
Copyright © AppDynamics 2012-2015 Page 3
Monitor Business Applications
Monitor Node.js Processes
Troubleshoot Slow Response Times
Organize Traffic as Business Transactions
Transaction Snapshots
Monitor Performance with Custom
Dashboards
Health Rules
Policies
Watch the video:
End-to-End Application Monitoring
The AppDynamics Node.js Agent helps you monitor Node.js applications in production to
determine which applications are slower than normal or producing a lot of errors. It also provides
tools for troubleshooting application problems so that you can take action before poor performance
becomes apparent to your users.
Node.js Agent
The agent consists of two components:
Node.js extension component: collects metrics from the Node.js application
proxy component: reports metrics to the Controller, which stores, baselines and analyzes
the data collected by the agent. The Controller can be the AppDynamics SaaS controller or
an on-premise AppDynamics controller at your workplace.
To access the data, you log in to the Controller from a Web browser using your AppDynamics
credentials. You can also access the data programmatically using the AppDynamics REST API.
Dashboard
After you install the agent and run some traffic through your application, log in to the Controller.
Typically the first thing you see is the application dashboard.
The flow map in the dashboard shows the flow of traffic through the entire application through the
various application servers (tiers) to the backends (databases, HTTP services, caches, etc). The
tiers are represented by circles.
The numbers inside the circles indicate how many nodes are in the tier. The node is the basic unit
of processing that the agent monitors; a node in the AppDynamics model is a single Node.js
process instrumented by an AppDynamics Node.js Agent. A tier represents a key service. The
backends themselves are not instrumented by the Node.js Agent, but the agent reports metrics for
flow from the tiers into them.
There are various pre-built dashboards throughout the AppDynamics UI.
The node dashboard for Node.js is like the node dashboards for the other app agents except:
It includes a Process Snapshots tab for accessing the process snapshots for the Node.js
Copyright © AppDynamics 2012-2015 Page 4
process.
It does not include a Memory tab for monitoring memory usage. However, per process
memory metrics are displayed under the Application Infrastructure Performance -> <tier> ->
Node.js -> Memory in the Metric Browser.
Business Transactions
To get an idea of how a user experiences various interactions with an application, monitor the
application’s business transactions. A business transaction corresponds to a user request.
Business transactions offer a customer-centric approach that helps you isolate where in your app
users may be experiencing problems. Click Business Transactions in the left navigation pane or
the Top Business Transactions tab in the application dashboard the list to see a list of business
transactions in your application. Then double-click one of the business transactions in the list,
perhaps one that is reporting long response times, to examine a single business transaction in
depth.
You can examine individual instances of a business transaction taken at a point in time. These are
called transaction snapshots. Transaction snapshots let you drill down to a call graph to help you
identify the root cause of the poor user experience for that transaction.
You may see business transactions in the flow map that pass through tiers that are not Node.js
servers. For example they may be Java or .NET. or PHP. Business transactions can be distributed
over multiple tiers, which may be built on different platforms. The type of the transaction is based
on the platform of the originating tier, which contains the entry point to the transaction. A business
transaction is a Node.js business transaction if the user’s entry point into the transaction is a
Node.js tier.
How business transactions are identified and named varies with the particular framework on which
the the application was built and can be fine-tuned using custom transaction detection
configuration.
Processes
One reason for slow load times is inefficient code that uses a lot of CPU time. In a single-threaded
model, such as Node.js, one slow process forces other processes to wait.
You can monitor Node.js processes using lists of process snapshots to identify which processes
have high CPU times. From the list you can select and examine process snapshots of slow
processes to identify exactly which functions in your code are blocking the CPU.
A process snapshot describes an instance of a CPU process on an instrumented Node.js node. It
generates a process-wide call graph for a CPU process over a configurable time range. Process
snapshots are independent of any running business transactions.
You can monitor process snapshots at the tier level or the node level.
Backends
A backend is an entity in the AppDynamics model that the app agent does not instrument directly,
but reports traffic flows to it. The Node.js Agent monitors flows to HTTP exit points, database exit
Copyright © AppDynamics 2012-2015 Page 5
points and cache exit points. See Supported Environments and Versions for Node.js for the
current list of supported backends.
You cannot configure detection and naming for Node.js backends.
Customizations
The Node.js Agent collects a lot of metrics that do not appear in the standard dashboards. You
can see all the metrics in the Metric Browser, including special metrics related to Node.js
processes under the Application Infrastructure Performance -> <tier> ->Node.js tree. You can
create custom dashboards that display any of these metrics using a variety of widgets to create a
visual display of information customized for specific types of users in your organization:
executives, ops, developers, qa and so forth.
You can also create health rules that stipulate certain levels of acceptable performance and then
create policies that automatically send an alert or take an automated action when those rules are
violated
Monitor Node.js Processes
On this page:
Automatic Process Snapshot Generation
Collect Process Snapshots Manually
Process Snapshots List
Related pages:
View Process Snapshots
Node.js Metrics
Process Snapshots and Business Transaction
Snapshots
Watch the video:
Access Process Snapshots
This topic explains how process snapshots are generated and viewed.
Automatic Process Snapshot Generation
When a business transaction snapshot is triggered by periodic collection or by a diagnostic
session, a ten-second process snapshot is automatically started. By default the agent starts no
more than two process snapshots per minute automatically, but this behavior is configurable.
You can also start process snapshots manually on demand. See Collect Process Snapshots
Manually below.
Configure Automatic Collection
Copyright © AppDynamics 2012-2015 Page 6
You can configure automatic process snapshot collection using the following settings:
processSnapshotCountResetPeriodSeconds: Frequency, in seconds, at which the
automatic process snapshot count is reset to 0, default is 60
maxProcessSnapshotsPerPeriod: Number of automatic process snapshots allowed in
processSnapshotCountResetPeriodSeconds seconds, default is 2
autoSnapshotDurationSeconds: Duration of an automatically-generated process
snapshot; default is 10 seconds
To configure these settings, add them to the require statement in your application source code as
described in Install the Node.js Agent. Then stop and restart the application.
Collect Process Snapshots Manually
If you want to generate some process snapshots now, you can start them manually.
1. Navigate to the dashboard for the tier or node for which you want to collect process
snapshots.
2. Click the Process Snapshots tab.
3. Click Collect Process Snapshots.
4. If you are in the tier dashboard, select the node for which you want to collect snapshots from
the Node dropdown list. If you are in the node dashboard, you can only set up snapshot
collection for that node.
5. Enter how many seconds you want to collect process snapshots for this node. The
maximum is 60 seconds.
6. Click Start.
The agent collects process snapshots for the configured duration.
Process Snapshots List
You can access the process snapshots list from the Process Snapshots tab of the node or tier
dashboard.
To examine a process snapshot, double-click it in the list. See View Process Snapshots for details
about what you see.
You can filter the process snapshot list to display only the snapshots that you are interested in.
You can filter by execution time, whether the snapshot is archived, and the GUID of the request. If
you access the list from the tier dashboard, you can also filter by node.
View Process Snapshots
Related pages:
Monitor Node.js Processes
Process Snapshots and Business Transaction
Snapshots
A process snapshot describes an instance of a CPU process on an instrumented Node.js node
From the process snapshots list, double-click the process snapshot that you want to view. You can
access the process snapshots list from the Process Snapshots tab of the node or tier dashboard.
Copyright © AppDynamics 2012-2015 Page 7
Process snapshots persist for 14 days, unless you archive them in which case they are available
forever.
A process snapshot contain the following tabs:
SUMMARY: Displays the execution time of the process, timestamp of the snapshot, CPU
time used, tier and node the process ran on, GUID of the request, etc..
You can click the link icon to copy a link of the snapshot URL.
CALL GRAPH: Shows the execution time of methods on the process's call stack.
In the Time column you can identify which calls take the longest time to execute.
Copyright © AppDynamics 2012-2015 Page 8
Click the at the end of the row to see more information about a call.
HOT SPOTS: Sorts calls by execution time, with the most expensive calls at the top.
To see the invocation trace of a single call in the lower panel, select the call in the upper
panel.
Use the slider in the upper right corner to filter which calls to display as hot spots. For
example, the following setting filters out all calls faster than 1.5 ms from the hot spots list.
BUSINESS TRANSACTIONS: This tab displays information about calls to the Node.js
process in the context of a business transaction. Information is displayed here when an
entire business transaction executes within the time covered by the process snapshot.
The Calls column reports the number of instances of the business transaction that were
Copyright © AppDynamics 2012-2015 Page 9
running during the time of the process snapshot. The Total Time is the sum of the execution
time for all those business transaction instances.
See Process Snapshots and Business Transaction Snapshots for information about what you
see in a call graph when part of a business transaction is captured in a process snapshot.
ADDITIONAL DATA : Displays the unique id of the process.
Node.js Metrics
On this page:
CPU Usage Metric
Memory Metrics
I/O Metrics
Socket.io Metrics
Event Loop Metrics
Related pages:
Metric Browser
This topic defines per process metrics that are specific to the Node.js Agent.
They are reported under the Application Infrastructure Performance -> <tier> ->Node.js tree in the
Metric Browser.
CPU Usage Metric
CPU Usage: % busy
Copyright © AppDynamics 2012-2015 Page 10
Description:Configure Node.js Custom Match and Exclude Rules . how to fine tune the Node.js Agent configuration for transaction detection. tools for troubleshooting application problems so that you can take action before poor performance.