AppDynamics Policy

Related Documentation
Made by
Kong Inc.
Incompatible with
on-prem
Minimum Version
AI Gateway - 2.0
Related Resources

This policy integrates AI Gateway with the AppDynamics APM platform so that requests handled by AI Gateway can be identified and analyzed in AppDynamics.

The AppDynamics policy reports request and response timestamps and error information to the AppDynamics platform to be analyzed in the AppDynamics flow map and correlated with other systems.

Important: Unlike other AI Gateway policies, you must configure the AppDynamics policy via environment variables. You must also install AppDynamics before using the policy, and you must enable the policy in your environment.

AppDynamics installation prerequisites

Before using the policy, download the AppDynamics C/C++ SDK on the machine or within the container running the AI Gateway data plane. To use the AppDynamics policy, the libappdynamics.so shared library must be available on all data plane nodes running AI Gateway. You can install the AppDynamics C/C++ SDK or extract the libappdynamics.so shared library, which is the only required file.

For information about installation and configuration, see the AppDynamics SaaS and AppDynamics On-Premises documentation.

We recommended installing the libappdynamics.so in the /usr/local/kong/lib directory. This directory is included in the AI Gateway search path for shared libraries, so the libappdynamics.so file will be found automatically.

If you’re using the AI Gateway quickstart container, perform the following steps:

  1. Extract the SDK:

    tar -xzf appdynamics-sdk-native-64bit-linux-VERSION.tgz
  2. Locate the library file:

    cd appdynamics-cpp-sdk/lib
  3. Copy the file into the container running the AI Gateway data plane:

    docker cp libappdynamics.so <container_id>:/usr/local/kong/lib

Alternative installation

If you prefer to install the libappdynamics.so file in a different location, you can do so.

  • If AI Gateway is deployed on RHEL or CentOS, the libappdynamics.so file can be in the /usr/lib64 directory, which is included in the default search path for shared libraries.
  • If AI Gateway is deployed on Debian or Ubuntu, the libappdynamics.so file can be in the /usr/lib directory, which is included in the default search path for shared libraries.
  • If these options aren’t available, the libappdynamics.so file can be in one of the locations configured by the system’s shared library loader.
  • Alternatively, the LD_LIBRARY_PATH environment variable can be set to the directory containing the libappdynamics.so file when starting AI Gateway.

Enable the AppDynamics policy

The AppDynamics policy is not bundled in AI Gateway packages by default. Before you configure the plugin, you must enable it:

  • Docker: Set export KONG_PLUGINS=bundled,app-dynamics in the environment
  • Kubernetes: Set KONG_PLUGINS=bundled,app-dynamics using the Custom Plugin instructions.
  • Package install: Set plugins=bundled,app-dynamics in kong.conf before starting AI Gateway.

AppDynamics policy configuration

The AppDynamics policy is configured through environment variables that must be set when AI Gateway is started. The AppDynamics policy uses the AppDynamics C/C++ SDK to send information to the AppDynamics controller. See the AppDynamics C/C++ SDK documentation for more information about the configuration parameters.

All non-default environment variables in the table must be set.

The policy uses the following environment variables:

Variable

Description

Type

Default

KONG_APPD_CONTROLLER_HOST Hostname of the AppDynamics controller. String
KONG_APPD_CONTROLLER_PORT Port number used to communicate with the controller. Integer 443
KONG_APPD_CONTROLLER_ACCOUNT Account name used with the controller. String
KONG_APPD_CONTROLLER_ACCESS_KEY Access key used with the AppDynamics controller. String
KONG_APPD_LOGGING_LEVEL Logging level of the AppDynamics SDK agent. Integer 2
KONG_APPD_LOGGING_LOG_DIR Directory where agent log files are written. String /tmp/appd
KONG_APPD_TIER_NAME Tier name used for business transactions. String
KONG_APPD_APP_NAME Application name reported to AppDynamics. String Kong
KONG_APPD_NODE_NAME Node name reported to AppDynamics. This value defaults to the system’s hostname. String hostname
KONG_APPD_INIT_TIMEOUT_MS Maximum time to wait for a controller connection when starting, in milliseconds. Integer 5000
KONG_APPD_CONTROLLER_USE_SSL Use SSL encryption in controller communication. true, on, or 1 are all interpreted as True, any other value is considered false. Boolean on
KONG_APPD_CONTROLLER_HTTP_PROXY_HOST Hostname of the proxy used to communicate with controller. String
KONG_APPD_CONTROLLER_HTTP_PROXY_PORT Port number of the controller proxy. Integer
KONG_APPD_CONTROLLER_HTTP_PROXY_USERNAME Username used to identify to proxy. This value is a string that is never shown in logs. This value can be specified as a vault reference. String
KONG_APPD_CONTROLLER_HTTP_PROXY_PASSWORD Password used to identify with the proxy. This value is a string that is never shown in logs. This value can be specified as a vault reference. String
KONG_APPD_CONTROLLER_CERTIFICATE_FILE Path to a self-signed certificate file. For example, /etc/kong/certs/ca-certs.pem. String
KONG_APPD_CONTROLLER_CERTIFICATE_DIR Path to a certificate directory. For example, /etc/kong/certs/. String
KONG_APPD_ANALYTICS_ENABLE Enable or disable Analytics Agent reporting. When disabled (default), Analytics-related logging messages are suppressed. Boolean false

Possible values for the KONG_APPD_LOGGING_LEVEL parameter

The KONG_APPD_LOGGING_LEVEL environment variable is a numeric value that controls the desired logging level.

Value

Name

Description

0 TRACE Reports finer-grained informational events than the debug level, which may be useful to debug an application.
1 DEBUG Reports fine-grained informational events that may be useful to debug an application.
2 INFO Default log level. Reports informational messages that highlight the progress of the application at a coarse-grained level.
3 WARN Reports on potentially harmful situations.
4 ERROR Reports on error events that may allow the application to continue running.
5 FATAL Fatal errors that prevent the agent from operating.

Agent logging

The AppDynamics agent sorts log information into separate log files, independent of AI Gateway logs. By default, log files are written to the /tmp/appd directory. This location can be changed by setting the KONG_APPD_LOGGING_LOG_DIR environment variable.

If problems occur with the AppDynamics integration, inspect the AppDynamics agent’s log files in addition to the AI Gateway logs.

Important: ARM isn’t supported by the AppDynamics agent. The agent only supports x86 architecture.

AppDynamics node name considerations

The AppDynamics policy sets the KONG_APPD_NODE_NAME to the local hostname by default, which typically reflects the container ID of the containerized application. Multiple instances of the AppDynamics agent must use different node names, and one agent must exist for each of AI Gateway’s worker processes, where the node name is suffixed by the worker ID. This results in multiple nodes being created for each AI Gateway instance, one for each worker process.

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!