Problems are automatically opened by Dynatrace when anomalies or alert conditions are detected in your environment.
In Workflows, build a simple workflow that listens to problems and automatically sends
Slack notifications whenever a new problem is triggered.
This guide shows you how.
In this tutorial, you'll learn how to alert your team in real time by automatically messaging the details of a new problem to a specific Slack channel.
At a short glance, you will:
Untitled workflow
, and enter a meaningful name.
The workflow type is set to simple workflow by default.Add an event trigger for Davis problems.
Configure a Slack message.
Select Add task on the trigger node.
In the Choose action section, select Send message action type.
Give the action type a meaningful title.
Select a pre-configured Slack connection.
Select a Slack connection from the Connection drop-down list.
Select a Slack channel for your message from the Channel drop-down list.
In the Message field, enter the following:
{"blocks": [{"type": "header","text": {"type": "plain_text","text": "{{ ':white_check_mark:' if event()['event.status'] == 'CLOSED' else ':warning:' }} {{ 'RESOLVED' if event()['event.status'] == 'CLOSED' else 'OPEN' }} - {{ event()['event.name']}}","emoji": true}},{"type": "section","text": {"type": "mrkdwn","text": "- *Problem link*: <{{ environment().url }}/ui/intent/dynatrace.davis.problems/view-problem#%7B%22event.id%22%3A%22{{ event()['event.id'] }}%22,%22event.kind%22%3A%22{{event()['event.kind']}}%22%7D|{{ event()['display_id'] }}> \n- *Impacted Entities:* `{{ event()['affected_entity_ids'] }}`\n- *Problem duration:* `{{ (event().get('resolved_problem_duration', 0) | int) / 1000000 / 1000 / 60 }} minutes`"}},{"type": "section","text": {"type": "mrkdwn","text": ">{{ event()['event.description'] | replace('\n', '\\n>') | safe }}"}},{"type": "divider"},{"type": "section","text": {"type": "mrkdwn","text": "*Workflow link*: <{{ environment().url }}/ui/apps/dynatrace.automations/workflows/{{ execution().workflow.id }}|Workflow>"}}]}
This configuration uses event context placeholders to populate the Slack message with relevant problem details dynamically.
The Davis problems trigger returns the problem record.
You can use any field from the problem record, stored in dt.davis.problems
, in the Slack message.
Save and run the workflow to send out Slack notifications.
Verify that your workflow is working as expected:
Go to your workflow.
Select Run.
Select Run again to execute the workflow.
After the workflow has executed, you should see a Success state at the top of the workflow editor. In case of an error, you can view the log output at the bottom of the editor for troubleshooting.
You’ve created a simple workflow that sends Slack messages when problems are opened or closed. This setup helps to ensure that your team is immediately informed about critical issues in your environment.
You can extend this workflow by
This workflow is a great starting point for automating incident response and improving operational awareness.