Dynatrace Cloud Automation
Flow Designer has a Dynatrace Cloud Automation Event trigger and a built-in Dynatrace Cloud Automation step to help you integrate Dynatrace Cloud Automation into your alert management and incident response flows.
Dynatrace Cloud Automation Steps
The following step is available:
- Finish Cloud Automation Event: sends a "finished" signal to Dynatrace Cloud Automation when preceding flow steps complete successfully. The "finished" signal allows the Cloud Automation sequence to continue.
The preceding graphic depicts an active Dynatrace Cloud Automation webhook. The flow is triggered by a Dynatrace Cloud Automation sequence notifying the Cloud Automation Event trigger. The flow then pulls commit information from GitHub, build information from Jenkins, and creates a work item in Azure DevOps Boards. The flow then connects to the Finish Cloud Automation Event step. If the commit, build, and work item steps are successfully completed, the Finish Cloud Automation step sends a signal (known as a finish event) back to Dynatrace Cloud Automation so the sequence can continue.
To add a Dynatrace Cloud Automation step to your flow:
- Go to the Apps tab, expand the Dynatrace section, and drag the Finish Cloud Automation Event step onto the canvas.
- For instructions on using the Dynatrace Cloud Automation Event trigger, see Dynatrace Cloud Automation Event trigger.
- Connect the step to the previous step in the flow. This gives you access to the alert properties and outputs of previous steps when you configure this step's inputs.
- Double-click the step to edit it, and use the Setup tab to configure the inputs. You can use plain text and input variables (or both). See the following section for detailed information on the inputs, including which are required.
- On the Endpoint tab, configure the step to point to your Dynatrace Cloud Automation instance.
- You can select a pre-existing endpoint or create a new endpoint.
Finish Cloud Automation Event
When a Cloud Automation Event trigger is targeted by an active webhook in Dynatrace, the Finish Cloud Automation Event step sends the required finished event back to Cloud Automation so it can continue the sequence. Place this step in the flow at the point you consider it finished for the purposes of the Dynatrace Cloud Automation sequence. This step is only required when your Dynatrace Cloud Automation sequence requires a response from xMatters.
Inputs
Inputs with an asterisk* are required.
Label |
Description |
---|---|
API Token* |
Keptn API token used by Dynatrace Cloud Automation to authenticate the request.
To obtain the Keptn API token, click on the person icon on the upper-right corner of the Dynatrace Cloud Automation interface.
|
Event Payload* | Raw Request of the original payload from the Dynatrace Cloud Automation Event trigger. |
Outputs
Label |
Description |
---|---|
Context |
Unique ID of the Keptn context. |
Dynatrace Cloud Automation Event trigger
The built-in Dynatrace Cloud Automation Event trigger initiates a flow when it receives a signal from Dynatrace Cloud Automation.
- Go to the Triggers tab in the palette, expand the App Triggers section, and drag the trigger onto the canvas.
- Double-click the trigger (or click the pencil icon).
- Set the authenticating user and then copy the URL — you'll use this to set up the webhook in Dynatrace Cloud Automation. Alternatively, you can create an integration user to use as the authenticating user.
- Click the Flood Control tab to edit the trigger's default flood control settings. For more information about these settings, see Trigger Flood Control.
- Click Done.
- On the flow canvas, connect the steps you want to run when xMatters receives a request to that URL.
You're now ready to configure Dynatrace Cloud Automation to target the trigger.
To have Dynatrace Cloud Automation send alerts to the flow trigger, you need to configure a webhook and set it to use the trigger URL.
- In Cloud Automation, select Uniform from the left-hand menu.
- On the Uniform page, select the webhook-service row.
- Click Add subscription.
- Fill in the following fields:
- Task:The task that triggers the woebhook.
- Task suffix: The task suffix sets whether the webhook is active or passive. Passive webhooks do not require a response from xMatters before continuing the sequence. Active webhooks stop a sequence from progressing until a response is received from xMatters. We recommend using passive webhooks whenever possible.
- To create a passive webhook, set the task suffix to started. Selecting started disables the "Send finished event" menu as no response is required to continue the sequence. This is the recommended option to ensure Dynatrace Cloud Automation processes sequences at the expected rate.
- To create an active webhook, set the task suffix to triggered, then set the Send finished event radio button to either automatically or by webhook receiver.
- If you use automatically, the sequence continues without needing a response from xMatters, which is similar to a passive webhook.
- If you select by webhook receiver, Cloud Automation stops the sequence and waits to receive a response from the xMatters Finish Cloud Automation Event step before continuing.
- Request Method: POST
- URL: Paste the trigger URL you copied from the Dynatrace Cloud Automation Event trigger in Flow Designer. Add the target names of any recipients you want xMatters to notify when the alert fires.
- For URL authentication, use an ampersand to attach recipients. For example, if you want to notify Emma Pearson and the on-call members in the group responsible for the Antares service, you'd add &recipients=epearson,antares to the end of the URL.
- For other authentication types, use a question mark to attach recipients. For example, if you want to notify Barry Gull and the on-call members in the group responsible for the Cassiopeia service, you'd add ?recipients=bgull,cassiopeia to the end of the URL.
- You must URL-encode any special characters or spaces in the target names.
- If you want to mask parts of the trigger URL, you can use a Dynatrace secret. For example, if the authentication method is URL Authentication, you can mask the API key in the trigger URL.
- The Filter by stages and services field is optional.
- Click Add custom header and supply the authentication method:
- For URL Authentication:
- Name: Content-Type
- Value: application/json
- For Basic Authentication:
- Name: Authorization
- Value: Basic<Base64_encoded_value>
- For API Key Authentication:
- Name: Authorization
- Value: Basic <Base64_encoded_value>
- Paste the following payload in the Custom payload field:
For Basic and API Key authentication you must Base64 encode the username and password (or API Key and secret) of an xMatters user with permission to access the workflow. You can create a Base64 encoded username and password (or API Key and secret) at https://www.base64encode.org/ or by typing echo “username:password” | base64 into a terminal.
Copy{
"data": {
"project": "{{.data.project}}",
"service": "{{.data.service}}",
"stage": "{{.data.stage}}"
},
"id": "{{.id}}",
"source": "{{.source}}",
"specversion": "{{.specversion}}",
"time": "{{.time}}",
"type": "{{.type}}",
"shkeptncontext": "{{.shkeptncontext}}"
} - Click Create subscription.
The Create subscription window opens.
You're ready to use the webhook to trigger automated flows, including steps such as sending alerts and initiating incidents, though we always recommend testing before putting things into use.
The trigger has the following outputs you can use as inputs to steps further along the flow.
Label |
Description |
---|---|
Recipients |
List of targeted recipients. Recipients are set by adding a recipients query parameter to the trigger URL when you configure the webhook in Dynatrace Cloud Automation. |
Event ID | Unique ID of the Dynatrace Cloud Automation event. |
Context | Unique ID of the Keptn context. |
Project Name | Name of the Dynatrace Cloud Automation project that triggered the event. |
Service Name | Name of the Dynatrace Cloud Automation service the event is associated with. |
Source | Source of the Dynatrace Cloud Automation event. |
Stage | Name of the stage in which the sequence ran. |
Timestamp | Timestamp of when the event started in Dynatrace Cloud Automation. |
Type |
Type of event triggered in Dynatrace Cloud Automation. |
Raw Request | JSON representation of the request. You can parse the raw request if you need additional details beyond the standard outputs. |