Related pages: |
This page describes the available settings that configure the Node.js Agent.
You can use environment variables for some of the settings. To apply the settings, add them to the require
statement for the Node.js Agent in the monitored application.
The Node.js Agent no longer supports the proxy as of version 21.9. |
The following table is the complete list of settings in the require statement that you insert into your application code. Not all of these settings are required.
|
You can configure the Node.js Agent to send default transaction data to the Analytics Agent.
To add a setting for the Analytics host and port with the following format, specify the host and port numbers. The Analytics Agent may report on the same or different host and port numbers from the Node.js Agent.
analytics: { host: <analyticsHostName>, port: <analyticsPortNumber>, ssl: <true / false> } |
In Analytics Settings, ensure to specify the values for the variables in their supported data types. |
Variables | Supported Data Type |
---|---|
host | String |
port | Number |
ssl | Boolean |
To configure Analytics data limits, see Configure Transaction Analytics for Node.js, PHP, and Python Applications.
On Windows, the Node.js Agent requires three additional ports:
proxyCommPort
: default is 10101
proxyRequestPort
: default is 10102
proxyReportingPort
: default is 10103
See Run the Node.js Agent on Windows.
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 of the Node.js Agent.
When you enable a sensitive data filter, the Controller displays asterisks for the values of matching environment variables or system properties.
dataFilters: [{ "appliesTo": "http-headers", "matchPattern": "host" }], |
By default, the Node.js Agent enables a sensitive data filter with an environment variables/system properties that contain the case-insensitive substring password|key
.
dataFilters: [{ "appliesTo": "env-vars", "matchPattern": "password|key" }], |
You can use sensitive URL filters to configure the agent to obfuscate sensitive information from the URLs in the Transaction Snapshot details.
urlFilters: [{ "delimiter": "/", "segment": "1", "matchPattern": "a", "paramPattern": "bar" }], |
The sensitive URL filter checks for the matchPattern
in one segment. To check for additional segments, you can add an additional JSON array.
The filter processes requests in the following format: /aa/bb/cc
→ ***/bb/cc
.
The |
Property Name | Description |
---|---|
urlFilters | An array that you can add more objects to if you want more rules on the segment. |
delimiter | Specifies the desired character as the URL segment endpoints. The agent splices the URL at each delimiter instance to create the segments. |
segment | Needs to be at least one number and in ascending order (such as 3,5 or 2,6 ). Wildcards (* ) are not possible. |
With the matchpattern
regex, the Node.js Agent decides whether or not to filter a specified segment.
If you have multiple rules, list the more specific rule before the more general rule. The rules listed in the array are evaluated based on order.
Rule A:
{ 'delimiter': '/', 'matchPattern': '[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}\/.{50,}', 'segment': '3,5' } |
Rule B:
{ 'delimiter': '/', 'matchPattern': '[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}', 'segment': '3' } |
In this example, the first rule, Rule A, should be listed before Rule B because rule A masks the third and fifth segment.
If Rule B were to be listed and evaluated before Rule A, the third segment will be masked and the fifth segment will not masked, potentially revealing sensitive information.
With the paramPattern regex, the Node.js Agent decides whether or not to filter a specified query parameter.
If you need to mask all URL parameters, you can add further instruction to the array.
{ "delimiter": "/", "matchPattern": "", "segment": "99", "paramPattern": ".+"} |
The Node.js Agent will filter out all URL parameters.
You can use sensitive message filters to configure the agent to obfuscate sensitive information contained within text messages collected by the agent from log messages or detail messages from exceptions.
messageFilters: [{ "messageType": "throwable", "matchPattern": "Error.*MySQL.", "redactionRegex": "SQL" }] |
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 Variable | Maps to | |
---|---|---|
APPDYNAMICS_CONTROLLER_HOST_NAME | controllerHostName | |
APPDYNAMICS_CONTROLLER_PORT | controllerPort | |
APPDYNAMICS_CONTROLLER_SSL_ENABLED | controllerSslEnabled | |
APPDYNAMICS_AGENT_ACCOUNT_NAME | accountName | |
APPDYNAMICS_LOGGER_OUTPUT_TYPE | You can stream logs to stdout by setting its value to console . | |
| You can set the logging level of the agent. Possible values include: | |
APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY | accountAccessKey | |
APPDYNAMICS_AGENT_APPLICATION_NAME | applicationName | |
APPDYNAMICS_AGENT_TIER_NAME | tierName | |
APPDYNAMICS_AGENT_NODE_NAME | nodeName | |
APPDYNAMICS_AGENT_UNIQUE_HOST_ID | - | |
APPDYNAMICS_ANALYTICS_HOST_NAME | host —in Analytics settings | |
APPDYNAMICS_ANALYTICS_PORT | port —in Analytics settings | |
APPDYNAMICS_ANALYTICS_SSL_ENABLED | ssl —in Analytics settings | |
UNIQUE_HOST_ID |
The unique host ID can be set to any value that will identify the host. If a value is not specified, the agent will generate the host ID.
|