Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update slack alerter docs #2981

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 14 additions & 3 deletions docs/book/component-guide/alerters/slack.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,28 @@ In order to use the `SlackAlerter`, you first need to have a Slack workspace set
Then, you need to [create a Slack App](https://api.slack.com/apps?new\_app=1) with a bot in your workspace.

{% hint style="info" %}
Make sure to give your Slack bot `chat:write` and `chat:write.public` permissions in the `OAuth & Permissions` tab under `Scopes`.
Make sure to give your Slack bot the following permissions in the `OAuth & Permissions` tab under `Scopes`:

* `chat:write`,
* `chat:write.public`
* `channels:read`
* `groups:read`
* `im:read`
* `mpim:read`

![Slack OAuth Permissions](../../.gitbook/assets/slack-alerter-oauth-permissions.png)

{% endhint %}

### Registering a Slack Alerter in ZenML

Next, you need to register a `slack` alerter in ZenML and link it to the bot you just created. You can do this with the following command:
Next, you need to register a `slack` alerter in ZenML and link it to the bot you just created. You can do this with the following commands:

```shell
zenml secret create slack_token --oauth_token=<SLACK_TOKEN>
zenml alerter register slack_alerter \
--flavor=slack \
--slack_token=<SLACK_TOKEN> \
--slack_token='{{ slack_token:oauth_token }}' \
--default_slack_channel_id=<SLACK_CHANNEL_ID>
```

Expand Down