On this page:

This topic describes the settings that are available for configuring the Node.js Agent. To apply the settings, add them to the require statement for the Node.js Agent in the monitored application. You can use environment variables for some of the settings, as described below. See Install the Node.js Agent for more information.  

General Settings

This is the complete list of settings in the require statement that you insert into your application code. Not all these settings are required.

Analytics Settings

If you are configuring the Node.js Agent to send the default transaction data to the Analytics Agent, add a setting for the analytics host and port using the following format:

analytics: {
    host: <analyticsHostName>,
    port: <analyticsPort>,
    SSL: <true || false>  }

The Analytics Agent may report on the same or different host and port numbers from the Node.js agent. In either case, you need to specify it here.

For more information see Collect Transaction Analytics Data.

Windows Settings

On Windows, the Node.js Agent requires three additional ports. See Install the Node.js Agent on Windows for more information.

Filter Sensitive Data

If your application contains sensitive data that should not be displayed in the Controller, you can apply the following data filters to the require statement for the Node.js Agent:

// Add a sensitive data filter 
dataFilters: [{
   "appliesTo": "http-headers",
   "matchPattern": "host"
}],
 
// Add an environment variable filter 
dataFilters: [{
   "appliesTo": "env-vars",
   "matchPattern": "password|key"
}],

// Add a sensitive URL filter 
urlFilters: [{
   "delimiter": "/",
   "segment": "1",
   "matchPattern": "a",
   "paramPattern": "bar"
}],

// Add a sensitive message filter 
messageFilters: [{
   "messageType": "throwable",
   "matchPattern": "Error.*proxy.",
   "redactionRegex": "proxy"
}]

Environment Variables

If you have not provided the required settings in the require statement, the agent uses the values of the following environment variables if those variables are set. If both are set, the require statement value takes precedence over the environment variable.

Environment VariableMaps to
APPDYNAMICS_CONTROLLER_HOST_NAME controllerHostName
APPDYNAMICS_CONTROLLER_PORTcontrollerPort
APPDYNAMICS_CONTROLLER_SSL_ENABLEDcontrollerSslEnabled
APPDYNAMICS_AGENT_ACCOUNT_NAMEaccountName
APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEYaccountAccessKey
APPDYNAMICS_AGENT_APPLICATION_NAMEapplicationName
APPDYNAMICS_AGENT_TIER_NAMEtierName
APPDYNAMICS_AGENT_NODE_NAMEnodeName
APPDYNAMICS_AGENT_UNIQUE_HOST_ID 
APPDYNAMICS_ANALYTICS_HOST_NAMEhost (in Analytics settings)
APPDYNAMICS_ANALYTICS_PORTport (in Analytics settings)
APPDYNAMICS_ANALYTICS_SSL_ENABLEDssl (in Analytics settings)
UNIQUE_HOST_ID

uniqueHostId

You can set the unique host ID to any value that you want to use to identify the host. If you do not specify a value, the agent will generate the host ID for you.

This environment variable is only supported in the proxyless version of Node.js.