JSPM

  • Created
  • Published
  • Downloads 14219
  • Score
    100M100P100Q133342F
  • License SEE LICENSE IN https://legal.appdynamics.com/SaaSandOnPremise_EULA.pdf

Performance Profiler and Monitor

Package Exports

  • appdynamics
  • appdynamics/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (appdynamics) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Introduction

You can monitor your Node.js applications in production with the AppDynamics Node.js Agent. The Node.js Agent enables real-time visibility of server health, server performance, and resource usage.

Performance issues can result in a slow or unavailable website. The Node.js Agent uses process-level visibility and proactive monitoring to reveal the internal workings of your application and infrastructure with policies, troubleshooting, and performance/capacity optimization. You can use process snapshots to examine your code execution at the multi-process level and identify the root cause of slow performance in minutes.

For supported Node.js versions, operating systems, and backends, see Node.js Supported Environments.


Before You Begin

To start the Node.js Agent, complete the following:

  • Obtain an AppDynamics account with a running Controller.
  • To sign up for a 15-day free trial, see AppDynamics Free Trial. You should receive an email with your Controller host and port.

Install the Node.js Agent

AppDynamics recommends that you update the Node.js Agent with every SaaS Controller release. To ensure that your agent contains the latest functionality and fixes, regularly update to a major Node.js Agent version.

All Node.js Agent versions are compatible with major Controller versions 4.4.1.0 and later. For certain features with Controller version dependencies, you will need to upgrade your Controller.

For more information, see Agent and Controller Compatibility.

To install the Node.js Agent, insert the following command in the root directory of your instrumented Node.js application:

npm install appdynamics

If you know you want the latest published agent version, you can use the next tag:

npm install appdynamics@next

If you know which specific version of the Node.js agent you want to install, you can specify it:

npm install appdynamics@<version>

Paste the following in your application as the very first line of your application source code, before any other require statement:

require('appdynamics').profile({
  controllerHostName: '<controller host name>',
  controllerPort: <controller port number>,
  controllerSslEnabled: false,  // Set to true if controllerPort is SSL
  accountName: '<AppDynamics_account_name>',
  accountAccessKey: '<AppDynamics_account_key>',
  applicationName: 'your_app_name',
  tierName: 'choose_a_tier_name',
  nodeName: 'choose_a_node_name'
 });

For more information, see Install the Node.js Agent and Application Monitoring.



Developer Guide


How to setup project locally

 Make sure you have stable node version installed ** 12 <= node <= 18 **  are current supported versions.

 We recommend using 16 or above.

cd agent-dlnative/nodejs
npm install

Build project

 We currently build the nodejs project with gradle. For more help https://docs.gradle.org/current/userguide/command_line_interface.html

 The root gradle file will be one level up i.e in root of agent-dlnative project.  The nodejs build.gradle file has all the task definitions and build logic.

../gradlew dev 

The above will build the project with local node version.

../gradlew 

To run build with configured node version in build.gradle

To run agent unit tests

../gradlew unittests_agent --info -Dnodejs.build.debug=true -Dnodejs.coverage.enabled=false

The above is an example to run unit tests for agent with coverage disabled

More example options for task are : ** unittests, integrationtests_agent, eslint **

Checkout more options : /nodejs/build.gradle


To create standalone build

../gradlew :nodejs:createStandAloneAgentForNodeVersion or ../gradlew createStandAloneAgentForNodeVersion

Other options are : createMasterTarNpmScript, testStandalonePackage


Where are these build settings / logic

 The logic to create packages and supported node versions are in nodejs/buildScripts/src folder.

 Check package.json to see what npm-scripts are available.

 You can individually run them as a npm command npm run-script &standAloneAgent


How to test applications with local changes in a test application

 Create an npm application  Install appdynamics pointing to your local build

npm install appdynamics {path_to_your_local_build_folder}/appdynamics

 Require appdynamics as demonstrated on top section of the readme  example

appd.profile({
  accountName: 'e2e-customer',
  accountAccessKey: 'e10aa1c5-29be-474b-bb51-ab0c56eea5e8',
  controllerHostName: 'master-saas-controller.e2e.appd-test.com',
  controllerPort: 8090,
  applicationName: 'upstream-test',
  tierName: 'enabled',
  openTelemetry: {
    enabled: true,
  },
  nodeName: 'node__gql',
  enableGraphQL: true,
  libagent: true,
  debug: true,
});

  1. Run your application and make requests
  2. Go to controller ui - example : https://master-saas-controller.e2e.appd-test.com
  3. Search for your application - example: upstream-test


Frequently asked questions

  1. My Application doesn't show up in the controller
     You probably have to update the access key.

  2. My integration tests throw "not able to find a module" running locally
     Go to your integration test folder - find package.json and run npm install there


How do I setup libagent locally

https://confluence.corp.appdynamics.com/pages/viewpage.action?spaceKey=AMC&title=NodeJS+Agent+with+Local+Libagent




Copyright (c) AppDynamics, Inc. 2021 CA. All rights reserved.