Slack for Workflows
Your Dynatrace environment can integrate with a Slack workspace. You can automate sending messages to Slack based on the events and schedules defined for your workflow.
Set up Slack integration
To use Slack workflow actions, you first need to install the Slack for Workflows app from Dynatrace Hub.
- In Dynatrace Hub, search for Slack for Workflows.
- Select the Slack for Workflows app and select Install.
After that, you need to perform some initial steps to set up the connection between Slack and your Dynatrace environment.
Allow Slack for outbound connections
Grant permissions to Workflows
Create Slack app
Authorize connection to Slack
Allow Slack for outbound connections
- Open the Settings app and go to Preferences > Limit Outbound Connections.
- Select Add item and add
slack.com
. - Select Save changes.
This way you can granularly control the web services your Dynatrace environment can connect to.
Grant permissions to Workflows
Some permissions are required by Workflows to run actions on your behalf. Other permissions are required by actions that come bundled with the Slack for Workflows itself.
To fine-tune permissions granted to Workflows
- Open Workflows and go to Settings > Authorization Settings.
- Make sure the following permissions are selected.
- Permissions for Workflows
app-engine:functions:run
- Permissions that necessary for Slack workflow actions:
app-settings:objects:read
app-settings:objects:write
state:app-states:read
state:app-states:write
state:app-states:delete
state:user-app-states:read
state:user-app-states:write
state:user-app-states:delete
- Permissions for Workflows
Create Slack app
For Slack workflow actions to interact with your Slack workspace, you first need to create a Slack App for Dynatrace and authorize its connection to Slack.
-
Go to Slack API and select Create an App.
-
In the Create an app window, select From an app manifest.
-
In the Pick a workspace to develop your app window, select the Slack workspace you want to connect to and select Next.
-
In the Enter app manifest below window, paste the manifest YAML provided below into the YAML tab. Replace
<app-name>
and<bot-name>
with values of your choice (for example,Dynatrace
). For more information on the manifest YAML, see Slack documentation.display_information: name: <app-name> features: bot_user: display_name: <bot-name> always_online: false oauth_config: scopes: bot: - channels:history - channels:join - channels:read - chat:write - chat:write.public - files:write - groups:history - groups:read - im:history - im:read - mpim:history - mpim:read - reactions:read - reactions:write settings: org_deploy_enabled: false socket_mode_enabled: false token_rotation_enabled: false
Authorize connection to Slack
Your Dynatrace Slack app requires an OAuth token to authorize sending messages to Slack.
- Go to Slack API, select Your Apps in the upper-right corner, and select the app you just created.
- Go to Features > OAuth & Permissions. If you're a workspace admin, you'll be able to copy the OAuth token for your workspace. Otherwise, you'll need to Request to Install it. After your app is enabled by your admin, you'll get access to the OAuth token as well.
- Copy the OAuth token.
- Return to Dynatrace, open Settings app, and go to Dynatrace apps > Slack Connections.
- Select Add item, give your Slack connection a name, and paste the OAuth token in Bot token.
- Save your changes.
Use Workflows with Slack
- Open Workflows
and select
to create a new workflow.
- In the Choose trigger panel, select the trigger best suited to your needs.
- On the trigger node, select
to browse available actions.
- Find
Slack Integration
in the Choose action panel and select Send message. - Select a pre-configured Slack connection.
- Select a channel to send your message to. Can't find your channel?
- Provide a message body. Format your message using Slack Markdown. It is also possible to use workflow expressions as input.
- To test your workflow, select Run.
Troubleshooting
The following are solutions to problems some people had with Slack integration.