On this page:

Related pages:

Your Rating:
Results:
PatheticBadOKGoodOutstanding!
16 rates

You can use the instructions in Install the Node.js Agent to install the Node.js Agent on Node.js applications running on Windows. However, there are a few additional considerations that apply to Windows environments, as described here. 

Proxy Ports

Depending on your Node.js environment on Windows, you may need to configure three ports in the Node.js require statement. These port settings are:

  • proxyCommPort: Default is 10101
  • proxyRequestPort: Default is 10102
  • proxyReportingPort: Default is 10103

All three ports must be in the range 1024-65535 inclusive.

Auto-Launch Windows Environments

The default behavior is for the Agent to auto-launch the proxy, where proxyAutolaunchDisabled is false.

If you allow the Agent to auto-launch, and you have one Node.js process per machine, the Agent will automatically use the default port values if they are available. In this case, you do not have to configure these settings. If the default ports are not available, in the require statement, you must configure these settings to ports that are available.

If you have multiple Node.js processes on a single machine each reporting to its own proxy, each process needs its own set of ports. In this case, in the require statement for each process, configure unique settings for all three ports.

Manual-Launch Windows Environments

Some environments have multiple Node.js processes on the same machine, all reporting to a single proxy. In these environments, it is necessary to launch the proxy manually, where proxyAutolaunchDisabled is true and to configure the three port settings.

The proxyCommPort setting in the require statement and the commPort option to the runProxy.cmd must be the same value. The agent and the proxy must use the same port.

The proxyRequestPort and the proxyReportingPort are two unused TCP ports that the user running the proxy has permission to bind to on Windows.

Each distinct app-tier-node combination on a single machine must use different request and reporting ports. Two processes reporting as the same app-tier-node may use the same request and reporting ports. Set these ports in the require statement for each app-tier-node combination.

Execute runProxy Manually on Windows

By default, the proxy component is automatically started when you start the agent. Use the command described here only if you have configured the agent for manual proxy launch.

Before any traffic is run on the instrumented server, execute runProxy.cmd to start the proxy using the following syntax. If you use the optional -d option, it must precede the -j option.

Usage: runProxy.cmd [-d <proxyDir>] -j <jreDir> [logDir] [commPort]

Options:
  -d <proxyDir> the directory where the proxy is installed; optional, defaults to the directory containing the runProxy.cmd script
  -j <jreDir> the directory where the JRE is installed; required
  logDir the directory the proxy should log to; optional, defaults to <proxyDir>\logs
  [commPort] port used for the proxy control channel on Windows; defaults to 10101; if specified it must match the proxyCommPort setting in the require statement

Example

This example assumes that the command is run from the root of the Node.js application instrumented by the agent.

.\node_modules\appdynamics\node_modules\appdynamics-proxy\proxy\runProxy.cmd 
		-j .\node_modules\appdynamics\node_modules\appdynamics-jre\jre /var/log/proxy 
		.\node_modules\appdynamics\node_modules\appdynamics-proxy\proxy\logs
		10101

Execute the runProxy Command Manually on Windows Task Scheduler

You can schedule the runProxy command in the Windows Task Scheduler.

  1. Open Task Scheduler.
  2. Click Create Basic Task.
  3. In the General tab, enter a name for your task.
  4. Select Run whether user is logged on or not.
  5. Check Run with highest privileges.
  6. In the Triggers tab, add a new trigger. Set the trigger to when the computer starts.
  7. In the Actions tab, create a new action. Set the action to Start a program.
  8. In the Program/script field, enter the following: 
    <app_root>/node_modules/appdynamics-proxy/proxy/runProxy.cmd
  9. In the Add arguments field, enter the following: 
    -d <app_root>/node_modules/appdynamics-proxy -j <app_root>/node_modules/appdynamics-jre/jre %TEMP% 10101
  10. In the Start in field, enter the following: 
    <app_root>/node_modules/appdynamics-proxy/proxy
  11. Click OK to finish the wizard.
  12. Reboot the system, and check the Task Manager for a Java process.
  • No labels