NOTE: This integration has been deprecated in favor of [the shiny](https://help.xmatters.com/integrations/monitoring/dynatrace.htm?cshid=DYNATRACE new one).
Dynatrace is a leading performance and application monitoring application. This integration extends the alerting capabilities to use xMatters. This is a closed loop integration for sending alerts out and updating the Problem in Dynatrace with event status, device delivery and response information from xMatters notifications.
Checkout the video:
- Dynatrace.zip - The communications plan Dynatrace sends events to
- JiraOutboundResponse.js - Optional outbound response script for creating a Jira issue with the problem ID. See below for details.
First, request a Dynatrace API Token.
You need to set a request header that includes an API token for authentication in each Dynatrace API call. To create your token in Dynatrace, click Settings
on the left navigation menu. Then expand the Integration
section and click Dynatrace API
. Click on the Generate key
button and enter a label for this integration, such as "xMatters-Integration" and click Add
.
After an API token is generated, expand the xMatters-Integration entry in the API Keys
section. Your API token appears in the Generated key text field.
For more details, see the Dynatrace documentation
This integration requires a REST API user to authenticate REST web service calls when injecting events. This user needs to be able to work with events, but does not need to update administrative settings. While you can use the default Company Supervisor role to authenticate REST web service calls, the best method is to create a user specifically for this integration with a dedicated "REST Web Service User" role that includes the permissions and capabilities. If this role does not exist in your deployment already, you may need to ask your xMatters Client Success Manager to create it for you. In the following example, this role is named "REST Web Service User". To create a REST API user:
- Log in to the target xMatters system.
- On the Users tab, click Add.
- Enter the appropriate information for your new user. Because this user will affect how messages appear for recipients, you may want to identify the user as specific to Dynatrace. For example: 1. First Name: Dynatrace 1. Last Name: Integration 1. User ID: dynatrace
- In the Roles area, add the REST Web Service User role.
- Click Add. Make a note of the user credentials and details. You will need them when configuring other parts of this integration.
The next step is to import the communication plan into xMatters. To import the communication plan:
- In the target xMatters system, click Import Plan from the Developer tab.
- Click Choose File, and then locate the downloaded communication plan (.zip file).
- Click Import Plan: * Importing the plan will automatically enable it, and enable its forms for web services.
- Once the communication plan has been imported, click Edit > Forms.
- For the AutoShare webhook form, click Web Service Only > Sender Permissions.
- Enter the REST API user you created above, and then click Save Changes.
The Dynatrace Incident form uses the default recipients specified on the Layout tab to determine who to notify about an incoming alert.
- On the Forms tab, click Edit > Layout.
- In the Recipients section, add all of the groups and users you want to receive Dynatrace Incident Alert notifications.
- Click Save Changes.
After you import the communication plan, you need to setup the xMatters and Dynatrace endpoints.
- From the communication plan, click the Integration Builder tab, and then click Edit Endpoints.
- Select the Dynatrace endpoint, update tbe Base URL with the value of your Dynatrace tenant URL. e.g. https://cpk75115.live.dynatrace.com . Specify the Username and Password of the Dynatrace REST API user you created above, and then click Save Changes.
- Close the Endpoints dialog box.
- Click Edit Constants
- Select the
DYNATRACE_API_TOKEN
constant, paste your Dynatrace API Token into the Value field, and then click Save Changes.
The Incident alert webhook has a URL that you need to use to target it from Dynatrace. To get the URL for an integration service:
- On the Integration Builder tab, expand the list of inbound integrations.
- Click the gear icon beside the Incident alert webhook, and then select Integration URL.
Copy the URL displayed in the dialog box to a text editor; you will use this URL in the next step.
Now that you've configured xMatters to integrate with your system, it's time to configure Dynatrace to integrate with xMatters. Note: The following sections require you to log into Dynatrace as an Environment Admin. Details on various roles and access levels in Dynatrace, see here.
-
Login to Dynatrce
-
Click Settings on the left navigation menu
-
Expand the Integration section and click Problem notifications.
-
Select the Custom integration button.
- In the Set up custom integration enter the following information:
- The name of the integration
- The Integration URL for your inbound integration
- The username password of the REST web service user
- The Custom JSON payload. You can use the default setting, or copy and paste the following to get the complete data set.
{
"ImpactedEntity": "{ImpactedEntity}",
"PID": "{PID}",
"ProblemDetails": "{ProblemDetails}",
"ProblemID": "{ProblemID}",
"ProblemImpact": "{ProblemImpact}",
"ProblemTitle": "{ProblemTitle}",
"ProblemURL": "{ProblemURL}",
"State": "{State}",
"Tags": "{Tags}"
}
- Toggle all Applications, Services Infrastructure Notification level to ON.
- Click Test button.
- If the test succeeds, the Save button will be activated. Click the Save button. Otherwise, check the setting to make sure the Webhook URL and user credentials are entered correctly.
To test the integration, run an application (or the lambda function) so that the CPU goes over the alert threshold.
The Incident alert will be triggered via the newly created Webhook, followed by these additional comments in the Activity Feed:
- An xMatters Event is created and set to Active
- A notification is sent to the recipient
There are several places you can inspect when troubleshooting why an Incident alert is not sent to xMatters, or when no responses are recorded in the Activity Feed.
The xMatters Integration Builder Activity Stream is a good place to look for when the the recipient doesn't receive any notification.
While on the Integration Builder tab, expand the Inbound Integrations section, click the gear icon beside the intended integration service, and then click Activity Stream.
The Activity Stream contains the incoming request, any logging statements, and the final event creation messages.
Similarly, the Activity Stream contains the outbound request sending to Dynatrace. The following example shows the Notification Responses activity stream:
The JiraOutboundResponse.js script is an outbound integration script for creating a Jira issue from the Dynatrace problem. When responding with Create Jira Ticket
, the jira issue will have the dynatraceProblemId
set. If the Dynatrace Add-on for Jira is installed, the side panel will have the Dynatrace details.
- Login to the xMatters instance as a developer
- On the Dynatrace communications plan, click Edit > Integration Builder.
- Expand the Outbound Integrations and click Add.
- Populate the following values:
Item | Value |
---|---|
Trigger | Notification responses |
Form | Incident Alert Webhook |
Action | Run a script |
Location | Cloud |
Name | Incident alert webhook - Notification responses - Create Jira Issue |
- Click Edit Script and paste in the contents of the JiraOutboundResponse.js script and click Save.
- Navigate to the
Incident Alert Webhook
form and click Edit > Responses. - Add a response and populate the following values:
Item | Value |
---|---|
Response | Create Jira Ticket |
Email Description | Stop escalations and create a Jira issue |
Voice Prompt | Create a Jira issue |
Options | Action: Assign to User Contribution: Positive |
- Next, add two constants with the following names and values, replacing with the relevant jira project settings:
Name | Value |
---|---|
JIRA_PROJECT_KEY | Jira Project Key here For example HELP |
JIRA_ISSUE_TYPE | Jira Issue Type for example IT Help |
- Add a new Endpoint with the following details:
Field | Value |
---|---|
Name | JIRA |
Base URL | Base url for the target Jira instance |
Authorization | Basic |
Username | Username for authentication into Jira |
Password | Password |
Preemptive | Checked |
Trigger a problem from Dynatrace and select the Create Jira Ticket
response option.
Then, in Jira search for the new Jira issue: