This page describes how to configure Transaction Analytics and Data Collectors for Node.js, PHP, and Python applications.
Make sure you have installed and configured the components described in Installing Agent-Side Components and, for on-premises, Custom Install and Events Service Deployment before attempting to configure Transaction Analytics.
To configure the Node.js Agent to send the default transaction data to the Analytics Agent, modify the require statement in your application.
Add these variables with the proper values to point to your Analytics Agent:
analytics: { host: <analyticsHostName>, port: <analyticsPort>, ssl: <true || false> } |
The Analytics Agent can be on the same host as the Node.js Agent or on a different host. See Install the Node.js Agent.
You can also configure the Node.js Agent to set limits on data sent to the Analytics Agent with these properties correlated to environment variables.
Property Name | Description | Environment Variable |
---|---|---|
analyticsMaxSegmentSizeInBytes | The maximum size of a business transaction segment collected in an Analytics request. By default, the value is 0.1MB. | APPDYNAMICS_ANALYTICS_MAX_SEGMENT_SIZE |
analyticsMaxSegmentsPerRequest | The maximum number of segments per Analytics request. By default, the value is 16. | APPDYNAMICS_ANALYTICS_MAX_SEGMENTS_PER_REQUEST |
analyticsMaxMessageSizeInBytes | The size of a single request body sent to the Analytics Agent. By default, the value is 1MB. | APPDYNAMICS_ANALYTICS_MAX_MESSAGE_SIZE |
Your require statement should look similar to the following example where your Analytics Agent is on localhost and listening on Port 9090:
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>', // Required applicationName: '<Your application name>', debug: false, tierName: '<Choose a tier name>', nodeName: '<Choose a node name>', // The Controller appends the node name with a unique number analyticsMaxSegmentSizeInBytes: 20, analyticsMaxSegmentsPerRequest: 20, analyticsMaxMessageSizeInBytes: 100, analytics: { host: 'localhost', port: 9090 }, logging: { 'logfiles': [ {'root_directory': '/tmp/appd', 'filename': 'echo_%N.log', 'level': 'TRACE', 'max_size': 5242880, 'max_files': 10 }, { 'root_directory': '/tmp/appd', 'filename': 'protobuf_%N.log', 'level': 'TRACE', 'max_size': 5242880, 'max_files': 10, 'channel': 'protobuf' }] } }); |
You can also collect additional data from your Node.js business transactions by using the Node.js API. To configure Transaction Analytics data collectors for Node.js, see txn.addAnalyticsData()
in the Node.js Agent API Reference.
Analytics data cannot be collected from PHP CLI programs. |
To collect Transaction Analytics from the PHP Agent:
Configure the PHP Agent to send the default transaction data to the Analytics Agent. Modify the .ini
file depending on the operating system under which your PHP Agent is installed.
By default, your .ini
file contains the following configuration where your Analytics Agent is on localhost
and listens to Port 9090:
agent.analyticsHostName = localhost agent.analyticsPort = 9090 |
Add the following variables with the proper values to point to your Analytics Agent:
agent.analyticsHostName = <analyticsHostName> agent.analyticsPort = <analyticsPort> |
The Analytics Agent can either be on the same host as the PHP Agent, or on a different host. For information about installing the PHP Agent, see Install the PHP Agent.
You must set the node level setting analytics-dynamic-service-enabled=true
for reporting analytics.
(Optional) If you require to report analytics data after a specific number of data events/transactions or after a specific time interval, configure the PHP Agent by adding the following parameters in the .ini
file:
agent.analyticsReportingFrequency = <time in seconds> agent.analyticsEventThreshold = <number of analytics transaction recorded> |
The default agent reporting frequency is 30 seconds and the default event threshold is 10K events/transactions.
HTTP/Method Invocation Data collectors for Analytics must be enabled for both transaction snapshots and Transaction Analytics to report data from the PHP Agent.
In order to collect the method return value with an MIDC, the value must be assigned to a variable.
$ret = function() |
If the return value is not stored in any variable, it displays as null
in both snapshot and Analytics data.
analytics-dynamic-service-enabled=true
node property to report analytics.The parent configuration is not supported for the |
To collect Transaction Analytics from the Python Agent, configure the Python Agent to send the default transaction data to the Analytics Agent:
Modify the Python Agent configuration file.
[services:analytics] host= <analyticsHostName> port= <analyticsPort> |
The default value of the host is |
Or,
Set these environment variables:
APPDYNAMICS_ANALYTICS_HOSTNAME
APPDYNAMICS_ANALYTICS_PORT
For details about how to set the environment variables, see Python Agent Settings. |
To enable SSL between Python Agent and Analytics Agent:
Obtain the root certificate of the CA authority that signed the Analytics Agent certificate.
Enable SSL and specify the path of the certificate file in the Python Agent configuration file.
[services:analytics] ssl= on ca-file=<path of the CA certificate file> |
Python Agent accepts the certificate file in If there are intermediate certificate authorities, specify the path of the chain of trust in place of the root certificate authority. |
Or,
Set these environment variables:
APPDYNAMICS_ANALYTICS_SSL_ENABLED
APPDYNAMICS_ANALYTICS_CAFILE