# AppDynamics Grafana Data Source
## Understand the plugin’s capabilities
Listings should all include:
1. Screenshots
Understand what data source the plugin is for Version? Level or other distinguisher?
Understand known limitations * I'd suggest we add a "known limitations" section, which includes things like the APIs and functionality not supported by this plugin. For example, The Jira plugin does not currently work with on-premise Jira, and it doesn't support alerting since Jira doesn't return time series data.
## Prerequisites
In order to use the AppDynamics data source you must meet these requirements:
* Grafana Enterprise with a [valid license](https://grafana.com/docs/grafana/latest/enterprise/activate-license/)
* Grafana user with a [server admin or org admin role](https://grafana.com/docs/grafana/latest/permissions/)
* AppDynamics user with the ability to generate a user key
## Known Limitations
Find this out. thx
## Version compatibility
"* Good to include supported versions of the data source as well, e.g. ""this plugin supports version 2 of the ServiceNow API""
* Would love to see the version compatibility of specific features, if needed, e.g. “range annotations work with Grafana 7.2 and above”
* Would be great to include version notes where applicable, as in ServiceNow here: https://github.com/grafana/servicenow-datasource"
(Optional) Read compatibilty recommendations
Verify that the plugin is installed
## Install the data source
To install the data source, [follow these instructions on grafana.com](https://grafana.com/grafana/plugins/dlopes7-appdynamics-datasource/?tab=installation)
## Get credentials from AppDynamics
After installing the AppDynamics plugin, follow these steps to set it up within Grafana. You can authenticate with a username and password (basic auth) or with an API Token.
### Create a role and user for the data source in AppDynamics
The data source will need `view` access to Account, Applications, Databases, and Analytics.
You can choose to use your own user account, or create a new one by following these steps:
1. Navigate to AppDynamics Administration
2. In the **Roles** tab and select the `+` button to create a new role, e.g. `grafana_readonly`
* In the **Account** tab of the Create Role section, add the permission `View Business Flow`
* In the **Applications** tab, check the `View` box to allow Grafana to view application data
* In the **Databases** tab, check the `View` box to allow Grafana to view database data
* In the **Analytics** tab, check the `Can view data from all Applications` box to allow Grafana to view application analytics data
7. In the **Users** tab of the Administration page, create a new user, e.g. `grafana`. Assign the new user (or a Group to which the user belongs) to the role you just created (e.g. `grafana_readonly`)
### Get your AppDynamics access key (password)
If you plan to authenticate using Basic Auth, then create an access key which can be used as your password within Grafana.
1. Log in to the AppDynamics Controller UI (for example https://your-company.saas.appdynamics.com/controller) as a user with view license permissions
2. Click the gear icon and select `License`.
3. Click on the Account tab. The account name appears next to the `Name` label. The account name is customer1 in a single tenant, on-premises Controller; the account name varies on SaaS Controllers.
4. Click `Show` next to the `Access Key` label to reveal the account default access key setting for this instance. Copy the `Access Key`
### Get an API Client Key
Follow these steps if you plan to authenticate using an API Key:
1. Log in to the AppDynamics Controller UI (for example https://your-company.saas.appdynamics.com/controller) as a user with administration permissions
2. Click the gear icon and select `Administration`
3. Click on the API Clients tab.
4. Click on Create to create a new API client.
5. Generate and copy the Client Secret to be used for [Grafana's AppDynamics Plugin](#configure-the-data-source-using-the-configuration-ui)
### Configure the data source
Follow [these instructions](https://grafana.com/docs/grafana/latest/datasources/add-a-data-source/) to add a new AppDynamics data source, and fill in the following fields:
#### Basic Fields
| Field | Description |
| ------- | ----------------------- |
| Name | A name for this particular AppDynamics data source |
| URL | Where AppDynamics is hosted, for example https://moria.saas.appdynamics.com |
| Access | Access mode controls how requests to the data source will be handled. Server should be the preferred way if nothing else is stated. |
#### Authentication Fields
<!-- TODO: Figure out TLS This needs help. TLS Client Auth, Skip TLS Verify, and With CA Cert are all to do with TLS. Why are they not in the options after you select TLS Client Auth https://grafana.com/docs/grafana/latest/administration/provisioning/ -->
Most data sources will use either Basic Auth or API Key.
| Field | Description |
| ----------------------- | - |
| Basic auth | Enter an AppDynamics user name and password |
| TLS Client Auth | Built-in option for authenticating using Transport Layer Security |
| Skip TLS Verify | |
| With Credentials | enable/disable with credentials headers |
| With CA Cert | Enable TLS authentication using CA cert |
| Forward OAuth Identity | Forward the identity of the oauth user signed in to Grafana, for cases where the same oauth provider is used for both Grafana and the data source |
| API Key | [API Client generated in AppDynamics](#get-a-api-client-key) |
Custom HTTP Header Data sources managed by Grafanas provisioning can be configured to add HTTP headers to all requests going to that datasource. The header name is configured in the jsonData field and the header value should be configured in secureJsonData.
### Configure the data source with provisioning
It is possible to configure data sources using config files with Grafana’s provisioning system. You can read more about how it works and all the settings you can set for data sources on [the provisioning docs page](https://grafana.com/docs/grafana/latest/administration/provisioning/#datasources)
Here are some provisioning examples for this data source using basic auth
```yaml
apiVersion: 1
datasources:
- name: AppDynamics
type: dlopes7-appdynamics-datasource
access: proxy
basicAuth: true
basicAuthUser: how do you get this?
basicAuthPassword: Access Key
editable: true
enabled: true
url: https://moria.saas.appdynamics.com
withCredentials: true
```
Here are some provisioning examples for this data source using an API Key
*Note*: If you have configured both an API Key and basic authentication, the API Key will be used.
```yaml
apiVersion: 1
datasources:
- name: AppDynamics
type: dlopes7-appdynamics-datasource
apikey: [Apikey]
```
## Query the data source
The AppDynamics query editor allows you to query AppD
## Import a dashboard for AppDynamics
See query examples
Explore Explore what?
Write your first query
Write a query using macros Should add Macros to this as well, where applicable. Here's an example for MySQL: https://grafana.com/docs/grafana/latest/datasources/mysql/#macros
## Get the most out of the plugin
### Import a dashboard for AppDynamics
Follow these [instructions](https://grafana.com/docs/grafana/latest/dashboards/export-import/#importing-a-dashboard) for importing a dashboard.
List of useful dashboards:
* [dashboard description](link-to-dashboard) <!-- TODO: make the exported appd dashboard useful and commit it to the repo -->
*
(Optional) Add annotations https://grafana.com/docs/grafana/latest/dashboards/annotations/
(Optional) Configure and use template variables https://grafana.com/docs/grafana/latest/variables/
(Optional) Add transformations https://grafana.com/docs/grafana/latest/panels/transformations/
(Optional) Set up alerting https://grafana.com/docs/grafana/latest/alerting/
## Learn more
Refer to external documentation or resources. For example, refer to the official data source documentation. Like Jira links to how to write JQL
## Release notes
"* This ought to be as automated as possible.
"
New features
Enhancements
Bug fixes
Known issues
Contact support Grafana Enterprise representative?