Archived - Triggering ThousandEyes Snapshots from AppDynamics

This article describes an older method of integrating AppDynamics and ThousandEyes. For a more complete integration method, see AppDynamics Bi-Directional Integration.

Now that you have integrated ThousandEyes alerts and embedded ThousandEyes widgets into an AppDynamics dashboard, you may want to perform some actions from one platform to the other.

One powerful action is to set a policy in AppDynamics that triggers a snapshot in ThousandEyes. ThousandEyes snapshots provide an easy way to share data about an incident with multiple users, teams, or external groups. Anyone with a ThousandEyes snapshot link has full access to the ThousandEyes UI and metrics, including web, network, BGP, and full path visualization.

How It Works

This integration point uses AppDynamics HTTP request templates - a webhook integration feature similar to a ThousandEyes alert webhook notification.

For each test associated with an AppDynamics application (or tier or node), you will generate an HTTP request to trigger a ThousandEyes snapshot for the test via the ThousandEyes API. The request can provide the snapshot time window and other dynamic information, because AppDynamics HTTP request templates use Apache Velocity to allow processing dynamic variables.

To set up this integration, you'll

  1. Create an HTTP request template.

  2. Set up an alert policy action that triggers these HTTP requests.

Creating an HTTP Request Template

To create an HTTP request template, do the following within AppDynamics:

  1. Under Alert & Respond, select HTTP Request Templates.

  2. Click + (New).

  3. Give the template a name, such as ThousandEyes snapshot.

  4. Set up the new template to trigger a ThousandEyes snapshot, as follows:

    • Custom Templating Variables

      Create the following template variables, which are required by the ThousandEyes Snapshot API:

      • accountId

      • testId

      • testName

     For information on how to retrieve your test ID and account ID, see [the ThousandEyes Developer Reference](
  • Request URL

    • Method field: POST

    • Raw URL field:${accountId}

  • Authentication

    • Type field: Basic

    • Username field: Your ThousandEyes username

    • Password* field: Your ThousandEyes API token

     For information on how to retrieve your ThousandEyes API token, see [the ThousandEyes Developer Reference](!authentication).
  • Payload

 The HTTP request template uses Apache VTL to format the time string in the request, based on when the HTTP request is called by an action or policy.
 The following shows a sample payload:
 #set( $String = '' )
 #set( $to = $String.format('%1$tY-%1$tm-%1$tdT%1$tH:%1$tM:%1$tS ', $latestEvent.eventTime))
 #set( $tohour = $String.format('%1$tH', $latestEvent.eventTime))
 #set($tohourint = 0)
 #set( $fromhourint = $tohourint.parseInt($tohour) - 1)
 #set( $fromhour = $fromhourint.toString())
 #set( $from = $String.format('%1$tY-%1$tm-%1$tdT%2$s:%1$tM:%1$tS ', $latestEvent.eventTime, $fromhour))
      "testId": ${testid},
      "displayName": "Snapshot from AppDynamics - ${testname} - ${to}",
      "from": "${from}",
      "to": "${to}",
      "isPublic": 1

4. Save the request template you have just created.

Creating an Action to Trigger the Snapshot for Each Application

Now that you have created the HTTP request template, you need to configure an alert policy action to trigger these HTTP requests.

  1. In AppDynamics, go to Alert & Respond > Actions and click + Create to create a new action.

  2. Select HTTP Request and select ThousandEyes Snapshot as the template (the template you created above.

  3. Enter the following for the test you want to trigger a snapshot on:

    • accountId

    • testId

    • testName

The test you choose here should be a ThousandEyes test that is associated with the particular app, tier, or business transaction that you are creating a Snapshot for.

Now you have an action that will trigger a ThousandEyes snapshot for a specific test.

  1. Associate the snapshot action you just created with a policy.

For further details, see the reference implementation on GitHub.

Last updated