Synthetic for Workflows
Latest Dynatrace
Synthetic for Workflows allows you to execute synthetic monitors on demand at selected locations within your workflows. Dynatrace can respond to any event and execute synthetic monitors within the workflows to assess its impact on user experience. Depending on the outcome, Workflows can notify the team by creating a Jira ticket, sending a Slack message, or initiating a remediation process.
With Synthetic for Workflows, you can choose which monitors you want to execute.
- A list of all available monitors.
- Monitors tagged with specific identifiers.
- Monitors assigned to particular frontend applications.
It is also possible to use workflow expressions to extract the list of monitors and locations from incoming events, which enables you to create reusable workflows.
Install Synthetic for Workflows
To use Synthetic for Workflow actions, you first need to install Synthetic for Workflows from Dynatrace Hub.
- In Dynatrace Hub , search for Synthetic for Workflows.
- Select Synthetic for Workflows and select Install.
After installation, synthetic_for_workflows
actions appear automatically in the Choose action section of Workflows.
Before you begin, ensure that your monitors are properly defined. To create a new monitor, search for Synthetic in Dynatrace Hub .
Grant permissions to Workflows
The permission you need are listed in Introduction to workflows. Additionally, for executing Synthetic for Workflows you need the following permissions
environment:roles:manage-settings,storage:buckets:read,storage:events:read
Example policy:
ALLOWapp-engine:apps:run,automation:workflows:read,app-engine:functions:run,automation:workflows:run,automation:workflows:write,environment:roles:manage-settings,storage:buckets:read,storage:events:read;
Use synthetic_for_workflows
action
Select synthetic monitors
To select monitors from the list for Synthetic for Workflows, you need to specify the synthetic monitors that you want to execute when the workflow is triggered. You can choose the monitor from Visual or From event. You can find the most relevant monitors by filtering the list by various criteria such as type, name, applications, and tags.
You can also
- Select With specific tags to browse through monitors with a particular tag.
- Choose Assigned to frontend applications to select monitors assigned to particular applications. You can find the available applications in the Select frontend applications list.
Select a synthetic location
In Select a synthetic location
- Select Visual or From event.
- For Visual select a synthetic location from the dropdown list.
- For From event, you can define the list of synthetic monitors you want to execute in the workflow based on the incoming event. To do this, you need to create an expression that enables the workflow to extract this information from the event and execute the selected monitors.
If you don't select any location, the monitor will be executed at the location defined in the monitor configuration.
Add metadata
With the Add metadata section you can enrich your synthetic result with execution context, such as the application name, version, development stage, and build version.
To add metadata
- Select Add metadata.
- Fill in Key and Value fields. In these fields, you can use workflow expressions.
- Your metadata saves automatically.
Configure monitor execution
You can customize execution settings that will be applied to all executions within Workflows.
To do this switch on or off any of the following:
- Stop on problem
- Fail on performance issue
- Fail on SSL warning
- Take screenshots on success
Synthetic results in Grail
Note that Synthetic does not generate Grail events for non-DPS tenants. All processing will rely solely on API data. To learn more about DPS licensing, see Dynatrace Platform Subscription (DPS).
Results from synthetic monitors executed on-demand are stored as events in Grail.
There are three types of events:
batch_status
- contains the summary result of all the monitor executions within the batchbrowser_monitor_execution
- contains detailed information for one browser monitor executionhttp_monitor_execution
- contains detailed information for one HTTP monitor execution
Integrate Synthetic for Workflows with Site Reliability Guardian
If you want to evaluate objectives based on the results from synthetic monitors, you can integrate Site Reliability Guardian (SRG) as the next action in your workflow.
To do this
- Select the on the
synthetic_for_workflows
task and then select Site Reliability Guardian from Choose action. This will trigger asite_reliability_guardian_1
task. - Select the
site_reliability_guardian_1
task. In Variables provide thebatchId
parameter from the synthetic result and the{{ result("synthetic_for_workflows_1")["event.id"] }}
value. You can replace"synthetic_for_workflows_1_"
with any other task name. - In Dynatrace Hub , search for Site Reliability Guardian.
- Select + Guardian button.
- In your guardian, select and select Variables.
- Select Add variable.
- Type in
batchId
in the Name field. In the Value field, provide the default value. Select the Add button to save your changes. - On the right-hand side, fill in the Guardian name.
- Select the Add new objective and provide one of the following DQL queries.
Note that queries for synthetic events from outside the Synthetic application, such as those from Notebooks, Dashboards, and SRG, are charged according to your rate card. For more details, see Events powered by Grail.
Use the following query to get the total duration of the whole batch.
fetch dt.synthetic.events| filter event.id == $batchId| fields dt.synthetic.result.duration
Use the following query to check if the batch finished successfully.
fetch dt.synthetic.events| filter event.id == $batchId| filter dt.synthetic.batch.status == "Success"| summarize count = count()