APM Node.js Agent
The APM Node.js Agent monitors Node.js-based web applications.
How to Access the Product Documentation
The CA Application Performance Management product documentation is now available on a wiki platform. We expect this will not only allow easier access to specific information, but also improve our ability to respond with improvements and enhancements.
You can access the documentation from https://support.ca.com/ as usual. In place of a bookshelf displaying, the documentation wiki displays.
In the wiki, you can access the Node.js Agent documentation by selecting Implementing Agents, Node.js Agent.
License
NOTICE: This product is owned and/or licensed by CA Technologies (“CA”).
An active license agreement for CA Application Performance Management (“License Agreement”) is required for its use. Your use of this product is governed by the terms of the License Agreement. If you do not have an active License Agreement with CA, you may not use this product.
For details, please contact CA.
Usage
The Probe Agent is the component that runs inside the Node.js application process. The Probe Agent instruments the Node.js application at startup. This simple agent only interacts with the Collector Agent and reports events to it. You deploy the Probe Agent using the Node Package Manager (NPM).
The Collector Agent is a standalone Java process that collects data from the Probe Agent and transmits the data to the Enterprise Manager.
Click here for detailed installation information.
Install the Probe Agent Globally (No Code Changes)
You can quick install the Probe Agent globally using default values and without any code modifications. This method makes the Probe Agent available to all your Node.js applications.
$ npm install --global ca-apm-probe
Then, run your app with it as you would with node:
$ cd my-app
my-app$ ca-apm-run <startup_script>
Install the Probe Agent Per Application (No Code Changes)
You can install the Probe Agent locally for each application. This method lets you selectively instrument and monitor each application.
$ cd to/your/app/root
my-app$ npm install --save ca-apm-probe
The Node.js Agent runs dynamically whenever you start your Node.js application.
Start the Node.js application:
my-app$ ./node_modules/bin/ca-apm-run <startup-script>
Install and Manually Configure the Probe Agent as an Application Dependency (Code Change)
You can install and manually configure the Probe Agent. You can install and run the Probe Agent locally as an application dependency. Optionally, you can manually configure your Node.js application for monitoring. Use the npm command to install the Probe Agent and add it as a dependency of your application. This setup avoids any modification of the system and keeps all dependencies local to the application.
$ cd to/your/app/root`
$ npm install --save ca-apm-probe
Add the following first line your application main entry point script (for example, server or server.js). Optionally, you can specify corresponding arguments. For example, if your Probe Agent is running on a different host or port, you can specify corresponding arguments.
var probe = require('ca-apm-probe').start(<collector-agent-host>, <collector-agent-port>, <probe-name>);`
For example, you can require the agent as early as possible in your application, specifying the host and port that you have configured to accept Node.js metrics.
require('ca-apm-probe')({
host: '55.123.456.236', // your Probe Agent host ```
port: 3001, // your Probe Agent port
appName: 'my-app', // name to report metrics under
});
// your code here...
Save and close the file.
Run your application as follows:
$ node <startup_script>
(Optional) Configure the APM Probe Agent
You can configure the properties for a Probe Agent by editing the config.json file.
Follow these steps:
- Go to the <INSTALL_DIR>/ca-apm-nodejs-probe directory.
- Open the config.json file in a text editor.
- Specify the values for the properties you want to configure:
- probeName–Specifies the name of the Probe Agent as you want it to appear in the Enterprise Manager and Workstation/Webview/Team Center.
- probeNameEnvKey–Specifies a probe name value for your environment variable.
port–Specifies the port number for the Collector Agent. The default value is 5005.
- logFile–Specifies the log file location. The default value is ./logs/Probe-.log.
- logLevel–Specifies the log level: debug|error|info|warn|disabled. The disabled value disables logging completely. The default value is info.
- Save and close the file.
- Restart the managed application.
Monitor Metrics
Click here to access wiki documentation for details.