Create a Template for PagerDuty

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

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

Before you Begin

Before you create a PagerDuty template, ensure the following:
  1. Integrate Splunk AppDynamics with PagerDuty. See PagerDuty.
  2. Copy the integration key and keep it securely for later use. Splunk AppDynamics uses this key to send alerts to PagerDuty.

Create a Template

To create a PagerDuty template:
  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 Variablessection, 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_key Enter 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.
  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:
      JSON
      {
      "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": "Splunk 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 Splunk AppDynamics"
      }
      ]
      }
  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.