To send an HTTP request action to PagerDuty from AppDynamics, you must create a template in AppDynamics. When AppDynamics triggers an action in response to an event, you can view the details of the action in your PagerDuty.

This document contains references to the PagerDuty documentation. AppDynamics does not own any rights and assumes no responsibility for the accuracy or completeness of such third-party documentation.

Before you Begin

  1. Integrate AppDynamics with PagerDuty. See PagerDuty.
  2. Copy the integration key and keep it securely for later use. AppDynamics uses this key to send alerts to PagerDuty.

Create a Template in AppDynamics

  1. In the menu bar, click Alert & Respond.
  2. Click HTTP Request Templates.
  3. Enter a name for the template. For example, Send alerts to PagerDuty.
  4. In the Custom Templates Variables section, click + Add Variables and add the following:

    Variable

    Default Value

    pd_event_type
    • To open incidents, enter trigger
    • To close incidents, enter resolve
    pd_integration_keyEnter the integration key copied from PagerDuty
  5. In the Request URL section:
    1. Select POST as Method.
    2. Enter https://events.pagerduty.com/generic/2010-04-15/create_event.json in the Raw URL field.
    3. Select UTF-8 as URL Encoding.
  6. In the Authentication section, select NONE as Type. If you want to enable mutual TLS authentication, select Also Turn on Mutual TLS. For more information about mutual TLS, see Configure and Enable Mutual TLS Authentication.
  7. In the Payload section:
    1. Select application/json as MIME Type.
    2. Select UTF-8 as Payload Encoding.
    3. Enter the following payload in the text box:

      {  
            "service_key": "${pd_integration_key}",
            "incident_key": "${latestEvent.node.name} - ${latestEvent.application.name}",
            "event_type": "${pd_event_type}",
            "description": "${latestEvent.displayName} on ${latestEvent.node.name}",
            "client": "AppDynamics",
            "client_url": "${controllerUrl}",
            "details": {
              "Event Name": "${latestEvent.displayName}",
              "Summary": "${latestEvent.summaryMessage}",
              "Event ID": "${latestEvent.id}",
              "GUID": "${latestEvent.guid}",
              "Event Time": "${latestEvent.eventTime}",
              "Event Type": "${latestEvent.eventType}",
              "Event Type Key": "${latestEvent.eventTypeKey}",
              "Application Name": "${latestEvent.application.name}",
              "Node Name": "${latestEvent.node.name}",
              "Message": "${latestEvent.eventMessage}",
              "Severity": "${latestEvent.severity}"
            },
            "contexts":[
              {
                "type": "image",
                "src": "${latestEvent.severityImage.deepLink}",
                "alt": "${latestEvent.severity}"
              },
              {
                "type": "link",
                "href": "${latestEvent.deepLink}",
                "text": "View this transaction in AppDynamics"
              }
            ]
      }
      JSON
  8. In the Response Handling Criteria section, click + Add Success Criteria and do the following:
    1. Select 200 as Status Code.
    2. Select the Expect Payload check box.
    3. Select application/json as Content Type.
  9. In the Settings section, select the One Request Per Event option.
  10. Click Save.