# Setup AppDynamics integration

## Introduction

Akamas leverages the CSV telemetry provider to integrate a variety of data sources, such as AppDynamics.

All integrations based on this provider consist of two phases:

1. Metric extraction from AppDynamics
2. Metric import via CSV provider

The first phase is composed of a set of scripts launched by a workflow task that interacts with the AppDynamics API and saves the metrics of interest for the experiment in a CSV file with a proper format.

The second phase is executed by the CSV telemetry provider, which imports the metrics from the CSV file.

## Prerequisites

To set up the integration, you need:

* A host (or a container) that can be accessed via SSH from Akamas to run the extraction scripts and host the generated CSV file.
* The host must have the following packages installed:
  * python 3.10+
    * [PyYAML ](https://pypi.org/project/PyYAML/)5.4.1
    * [requests ](https://pypi.org/project/requests/)2.25.1
    * [urllib3 ](https://pypi.org/project/urllib3/)1.26.16
* The host must be able to connect to AppDynamics APIs
* A token to authenticate to your AppDynamics account and extract the metrics

## Script setup

The script required to set up this integration is not currently publicly available. To obtain them, please contact <support@akamas.io>.

You can deploy the scripts once and then re-use them for multiple studies as all the required configurations can be provided as arguments which can be changed directly in the akamas workflow yaml or from the UI.

To deploy the scripts, extract the archive to a location of your choice on the host. The files must have the following organisation:

```
── get_metrics.py
── utils/
    │   mv_utils.py
    │   mv_config.py
```

You can verify that the script can be executed correctly by running the following command.

{% code overflow="wrap" %}

```bash
python3 get_metrics.py -f <filename> -c <component> -a <application> -t <tier> -n <node> -st <startTime> [-et <endtime>] [-u <user>] [-p <password>]

```

{% endcode %}

The script accepts the following parameters:

* **Filename** \[-f, --filename]: **\[Required]** name that must have the generated output file (specify also the extension .csv)
* **Component** \[-c, --component]: **\[Required]** name of the Akamas component we want to associate the metrics with
* **Application** \[-a, --application]: **\[Required]** name of the AppDynamics application for which we want to retrieve the metrics
* **Tier** \[-t, --tier]: **\[Required]** name of the AppDynamics tier for which we want to retrieve the metrics
* **Node** \[-n, --node]: **\[Required]** name of the AppDynamics node for which we want to retrieve the metrics
* **StartTime** \[-st, --startTime]: **\[Required]** time for which we want to start to retrieve the data
* **EndTime** \[-et, --endTime]: **\[Optional]** time for which we want to start to retrieve the data (Default value = now)
* **User** \[-u, --user]: **\[Optional]** username to connect to the environment (Default value -> value taken from mv\_config file)
* **Password** \[-p, --password]: **\[Optional]** password to connect to the environment (Default value -> value taken from mv\_config file)

## Supported Metrics

Here you can find a subset of the supported metrics. Metrics from AppDynamics are mapped to metrics from the Akamas optimisation pack. In general, all metrics of AppDynamics can be imported in Akamas if inserted in the config file

### Infrastructure and runtime

jvmRuntimePlatform

<table><thead><tr><th>AppDynamics Metric</th><th width="226">Akamas Component Type</th><th>Akamas Metric</th></tr></thead><tbody><tr><td>Application Infrastructure Performance|{tier}|Individual Nodes|{node}|JVM|Memory|Heap|Max Available (MB)</td><td>java-openjdk-XX</td><td>jvm_heap_size</td></tr><tr><td>Application Infrastructure Performance|{tier}|Individual Nodes|{node}|JVM|Memory|Heap|Current Usage (MB)</td><td>java-openjdk-XX</td><td>jvm_heap_used</td></tr><tr><td>Application Infrastructure Performance|{tier}|Individual Nodes|{node}|JVM|Memory|Heap|Used %</td><td>java-openjdk-XX</td><td>jvm_heap_util</td></tr><tr><td>Application Infrastructure Performance|{tier}|Individual Nodes|{node}|JVM|Garbage Collection|GC Time Spent Per Min (ms)</td><td>java-openjdk-XX</td><td>jvm_gc_time</td></tr><tr><td>Application Infrastructure Performance|{tier}|Individual Nodes|{node}|JVM|Threads|Current No. of Threads</td><td>java-openjdk-XX</td><td>jvm_threads_current</td></tr><tr><td>Application Infrastructure Performance|{tier}|Individual Nodes|{node}|JVM|Process CPU Usage %</td><td>java-openjdk-XX</td><td>cpu_util</td></tr><tr><td>Application Infrastructure Performance|{tier}|Individual Nodes|{node}|Hardware Resources|Memory|Used (MB)</td><td>java-openjdk-XX</td><td>mem_used</td></tr></tbody></table>

Linux

<table><thead><tr><th>AppDynamics Metric</th><th width="219">Akamas Component Type</th><th>Akamas Metric</th></tr></thead><tbody><tr><td>Application Infrastructure Performance|{tier}|Individual Nodes|{node}|Hardware Resources|Network|Outgoing KB</td><td>Ubuntu XX.XX</td><td>network_out_bytes_details</td></tr><tr><td>Application Infrastructure Performance|{tier}|Individual Nodes|{node}|Hardware Resources|Network|Incoming KB</td><td>Ubuntu XX.XX</td><td>network_in_bytes_details</td></tr><tr><td>Application Infrastructure Performance|{tier}|Individual Nodes|{node}|Hardware Resources|Disks|KB read/sec</td><td>Ubuntu XX.XX</td><td>disk_read_bytes</td></tr><tr><td>Application Infrastructure Performance|{tier}|Individual Nodes|{node}|Hardware Resources|Disks|KB written/sec</td><td>Ubuntu XX.XX</td><td>disk_write_bytes</td></tr><tr><td>Application Infrastructure Performance|{tier}|Individual Nodes|{node}|Hardware Resources|Memory|Used %</td><td>Ubuntu XX.XX</td><td>mem_util</td></tr><tr><td>Application Infrastructure Performance|{tier}|Individual Nodes|{node}|Hardware Resources|Memory|Total (MB)</td><td>Ubuntu XX.XX</td><td>mem_total</td></tr></tbody></table>

### Service

<table><thead><tr><th>AppDynamics Metric</th><th width="196.3333740234375">Akamas Component Type</th><th>Akamas Metric</th></tr></thead><tbody><tr><td>Overall Application Performance|Calls per Minute</td><td>Web Application</td><td>transactions_throughput</td></tr><tr><td>Overall Application Performance|Errors per Minute</td><td>Web Application</td><td>transactions_error_throughput</td></tr><tr><td>Overall Application Performance|Average Response Time (ms)</td><td>Web Application</td><td>transactions_response_time</td></tr></tbody></table>
