ca-agent

1.0.0 • Public • Published

ca-agent

APM agent for reporting Node.js application metrics to EP Agent.

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, then Node.js Agent Implementation guide.

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 EP Agent can be used via a runner script, or via API integration.

The runner script allows use of the agent with zero code modifications, but using a runner script instead of node may not be feasible in all environments.

Using EP Agent with a global runner (no code change required)

The simplest way to collect metrics from a node application and report it to your EP Agent is to install ca-agent globally and use ca-agent-run to run your application.

$ npm install --global ca-agent

Then, run your app with it as you would with node:

cd my-app
my-app$ ca-agent-run .

By default, ca-agent-run will configure ca-agent to report to localhost:8080. The host and port can be changed by setting the EPAGENT environment variable.

$ EPAGENT=http://stats-server.mydomain:8000 ca-agent-run my-app

Using EP Agent with a local runner (no code change required)

It is also possible to install ca-agent as an application dependency, avoiding any modification of the system and keeping all dependencies local to the application:

cd to/your/app/root
my-app$ npm install --save ca-agent

Note the lack of --global option to npm install in the above.

Then, run your app with it as you would with node:

my-app$ ./node_modules/.bin/ca-agent-run .

Using EP Agent via API integration (no runner required)

First, install the agent and add it as a dependency of your application.

$ npm install --save ca-agent

Then, require the agent as early as possible in your application, specifying the host and port that you have configured your EP Agent to accept metrics on.

require('ca-agent')({
    host: '54.191.244.236',  // your EP Agent host
    port: 8080,              // your EP Agent REST API port
    appName: 'my-app',       // name to report metrics under
});
// your code here...

Metrics

Metrics will appear hierarchically in EPAgent under the prefix Strongloop|$hostname|$appName|<metric> and with the following names and types:

  • StrongLoop | $hostname | $appName
    • gc
      • heap
        • used (IntCounter)
    • heap
      • used (IntCounter)
      • total (IntCounter)
    • cpu
      • user (IntCounter)
      • system (IntCounter)
      • total (IntCounter)
    • http
      • connection
        • count (IntCounter)
      • average (IntAverage)
      • maximum (IntAverage)
      • minimum (IntAverage)
    • backends | $backendHost
      • average (IntAverage)
      • maximum (IntAverage)
      • minimum (IntAverage)
    • loop
      • "count (ticks)" (PerIntervalCounter)
      • "minimum (ms)" (IntCounter)
      • "maximum (ms)" (IntCounter)
      • "average (ms)" (IntAverage)

Readme

Keywords

none

Package Sidebar

Install

npm i ca-agent

Homepage

www.ca.com/

Weekly Downloads

1

Version

1.0.0

License

CA License Agreement

Last publish

Collaborators

  • dhmlau
  • 0candy
  • hacksparrow