> ## Documentation Index
> Fetch the complete documentation index at: https://docs.easyalert.io/llms.txt
> Use this file to discover all available pages before exploring further.

# AppDynamics

> Receive alerts from Splunk AppDynamics APM

## Overview

Easyalert automatically detects and processes HTTP Request Action webhooks from Splunk AppDynamics.

***

## Requirements

* **Splunk AppDynamics** account (SaaS or On-Premises)
* **Easyalert account** and active tenant
* **Admin** or **Account Owner** permissions in AppDynamics

***

## Setup Instructions

<Steps>
  <Step title="Create Integration in Easyalert">
    1. Go to **Integrations** page from left menu
    2. Click **Add Integration** button
    3. Select **AppDynamics** as **Source Type**
    4. Enter a name (e.g., `AppDynamics Production`)
    5. Click **Create** to save
    6. Copy the generated **Webhook URL**

    > **Example:** `https://api.easyalert.io/api/v1/webhooks/ingest/wh_abc123...`
  </Step>

  <Step title="Create HTTP Request Template">
    Go to **Alert & Respond → HTTP Request Templates → New**

    | Field           | Value               |
    | --------------- | ------------------- |
    | **Name**        | `Easyalert Webhook` |
    | **Request URL** | Your Webhook URL    |
    | **Method**      | `POST`              |
    | **MIME Type**   | `application/json`  |
  </Step>

  <Step title="Configure Payload Template">
    Use this recommended payload:

    ```json theme={null}
    {
      "event_name": "${latestEvent.displayName}",
      "event_guid": "${latestEvent.guid}",
      "event_id": "${latestEvent.id}",
      "policy": "${policy.name}",
      "event_time": "${latestEvent.eventTime}",
      "app_id": "${latestEvent.application.id}",
      "app_name": "${latestEvent.application.name}",
      "event_message": "${latestEvent.eventMessage}",
      "severity": "${latestEvent.severity}",
      "event_deep_link": "${latestEvent.deepLink}",
      "controller_url": "${controllerUrl}",
      "node_id": "${latestEvent.node.id}",
      "node_name": "${latestEvent.node.name}",
      "summary": "${latestEvent.summaryMessage}",
      "event_type": "${latestEvent.eventType}",
      "tier_id": "${latestEvent.tier.id}",
      "tier_name": "${latestEvent.tier.name}",
      "health_rule_id": "${latestEvent.healthRule.id}",
      "health_rule_name": "${latestEvent.healthRule.name}",
      "incident_id": "${latestEvent.incident.id}",
      "account_name": "${account.name}",
      "customer": "YOUR_CUSTOMER_NAME",
      "team": "YOUR_TEAM_NAME",
      "environment": "production"
    }
    ```
  </Step>

  <Step title="Create Action">
    1. Go to **Alert & Respond → Actions → Create**
    2. **Action Type**: `HTTP Request`
    3. **Name**: `Easyalert Notification`
    4. **HTTP Request Template**: `Easyalert Webhook`
    5. Click **Save**
  </Step>

  <Step title="Attach to Policy">
    1. Go to **Alert & Respond → Policies**
    2. Edit or create a policy
    3. In **Actions** section:
       * **On Policy Open - Warning** → Easyalert Notification
       * **On Policy Open - Critical** → Easyalert Notification
       * **On Policy Close** → Easyalert Notification
  </Step>
</Steps>

***

## Template Variables

AppDynamics uses Apache Velocity syntax (`${variable}`):

| Variable                          | Description                       |
| --------------------------------- | --------------------------------- |
| `${latestEvent.eventType}`        | Event type (POLICY*OPEN*\*, etc.) |
| `${latestEvent.id}`               | Event ID                          |
| `${latestEvent.guid}`             | Event GUID                        |
| `${latestEvent.displayName}`      | Event display name                |
| `${latestEvent.severity}`         | Severity (INFO, WARN, ERROR)      |
| `${latestEvent.summaryMessage}`   | Event summary                     |
| `${latestEvent.eventMessage}`     | Event message                     |
| `${latestEvent.application.name}` | Application name                  |
| `${latestEvent.tier.name}`        | Tier name                         |
| `${latestEvent.node.name}`        | Node name                         |
| `${latestEvent.healthRule.name}`  | Health rule name                  |
| `${latestEvent.incident.id}`      | Incident ID                       |
| `${policy.name}`                  | Policy name                       |
| `${latestEvent.deepLink}`         | Link to event in AppDynamics      |
| `${controllerUrl}`                | Controller URL                    |
| `${account.name}`                 | Account name                      |

***

## Field Mapping

| AppDynamics Field           | Easyalert Field |
| --------------------------- | --------------- |
| `incident_id` / `event_id`  | Event ID        |
| `event_name` / `summary`    | Title           |
| `summary` / `event_message` | Description     |
| `event_type`                | Status mapping  |
| `severity`                  | Severity        |
| `node_name` / `tier_name`   | Host            |
| `app_name`                  | Service         |
| `event_deep_link`           | URL             |

***

## Event Types and Status Mapping

| Event Type                  | Easyalert Status |
| --------------------------- | ---------------- |
| `POLICY_OPEN_WARNING`       | Problem          |
| `POLICY_OPEN_CRITICAL`      | Problem          |
| `POLICY_CONTINUES_WARNING`  | Problem          |
| `POLICY_CONTINUES_CRITICAL` | Problem          |
| `POLICY_UPGRADED`           | Problem          |
| `POLICY_DOWNGRADED`         | Problem          |
| `POLICY_CLOSE_*`            | OK               |
| `POLICY_CANCELED_*`         | OK               |

***

## Severity Mapping

| AppDynamics Severity | Easyalert Severity |
| -------------------- | ------------------ |
| `ERROR`              | Critical           |
| `WARN`               | Warning            |
| `INFO`               | Info               |

***

## Custom Field → Tag Conversion

**All custom fields** you add to the template are automatically captured as tags.

### Example

Added to template:

```json theme={null}
{
  ...
  "customer": "AcmeCorp",
  "team": "backend",
  "datacenter": "EU-West",
  "cost_center": "CC-1234"
}
```

In Easyalert:

```
tags.customer = "AcmeCorp"
tags.team = "backend"
tags.datacenter = "EU-West"
tags.cost_center = "CC-1234"
```

***

## Routing Examples

**Escalation Routing:**

```
tags.customer equals "AcmeCorp" → Acme Corp Policy
tags.app_name equals "Payment Service" → Payment Team Policy
tags.environment equals "production" → Production Policy
```

**Notification Rules:**

```
tags.severity equals "ERROR" → call + sms + email
tags.tier_name equals "Database" → DBA Team channel
```

***

## Test

```bash theme={null}
curl -X POST "YOUR_WEBHOOK_URL" \
  -H "Content-Type: application/json" \
  -d '{
    "event_name": "High CPU Alert",
    "event_guid": "test-123",
    "event_type": "POLICY_OPEN_CRITICAL",
    "severity": "ERROR",
    "app_name": "TestApp",
    "node_name": "server-01",
    "summary": "CPU exceeded 90%",
    "event_deep_link": "https://appdynamics.example.com",
    "incident_id": "INC-001",
    "customer": "TestCustomer",
    "team": "test-team"
  }'
```

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Alerts not being received">
    1. Verify HTTP Request Template is configured correctly 2. Check that action
       is added to the policy 3. Verify health rule is enabled and triggering 4.
       Test template from AppDynamics UI
  </Accordion>

  <Accordion title="Custom fields not becoming tags">
    1. Verify field is added to webhook payload template 2. Check field name
       spelling 3. View webhook samples in Easyalert
  </Accordion>

  <Accordion title="Recovery events not resolving incidents">
    1. Verify "On Policy Close" action is configured in policy 2. Check
       `incident_id` is consistent between open and close events 3. Ensure
       event\_type includes POLICY\_CLOSE events
  </Accordion>

  <Accordion title="Missing node/tier information">
    1. Ensure variables include node and tier 2. Some events may not have
       node-level data 3. Use tier as fallback when node is empty
  </Accordion>

  <Accordion title="Template errors">
    1. Test template with "Test" button in AppDynamics 2. Check variable syntax
       (Apache Velocity) 3. Ensure all referenced fields exist
  </Accordion>
</AccordionGroup>

***

## Best Practices

<AccordionGroup>
  <Accordion title="Include Deep Links">
    Always include `${latestEvent.deepLink}` so responders can quickly navigate
    to AppDynamics for details.
  </Accordion>

  <Accordion title="Use Incident ID">
    Use `incident_id` for event correlation to properly group and resolve
    related alerts.
  </Accordion>

  <Accordion title="Configure All Event Types">
    Include close/cancel events in your policy to automatically resolve
    incidents in Easyalert.
  </Accordion>

  <Accordion title="Add Custom Fields for Routing">
    Include `customer`, `team`, `environment` in payload for escalation routing.
  </Accordion>

  <Accordion title="Leverage Business Transactions">
    Monitor business transaction health for business-impact visibility.
  </Accordion>
</AccordionGroup>
