Skip to content

Commit

Permalink
Merge pull request #1348 from elementary-data/ele-2285-add-alert-rule…
Browse files Browse the repository at this point in the history
…s-to-docs

Ele 2285 add alert rules to docs
  • Loading branch information
ellakz authored Jan 4, 2024
2 parents 5737f36 + 4abf46a commit 7453a27
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 80 deletions.
35 changes: 35 additions & 0 deletions docs/cloud/guides/alert-rules.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: "Alert rules"
---

Elementary cloud allows you to create rules that route your alerts.
Each rule is a combination of a filter and a destination.

The Slack channel you choose when connecting your Slack workspace is automatically added as a default alert rule, that sends all the alerts to that channel without any filtering.
To modify, deactivate or add more rules, simply navigate to the "Alert routing rules" page in the left menu.

<p>
<Frame>
<div className="dark:bg-white rounded-md p-4">
<img src="/pics/cloud/alert_rules.png" alt="Alert routing rules screen" />
</div>
</Frame>
</p>

<p>
<Frame>
<div className="dark:bg-white rounded-md p-4">
<img
src="/pics/cloud/alert_rules_drawer.png"
alt="Create a new alert rule or edit an existing one"
/>
</div>
</Frame>
</p>

<Tip>
When the alerts are fetched, each alert is evaluated against all the rules,
until a rule matches. The alert is then routed to the destination of the
matching rule, and no further rules are evaluated. This is why the order of
the rules matters!
</Tip>
2 changes: 1 addition & 1 deletion docs/cloud/guides/alerts-configuration.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Alerts configuration"
title: "Alert configuration"
---

<Snippet file="guides/alerts-code-configuration.mdx" />
83 changes: 5 additions & 78 deletions docs/cloud/guides/enable-slack-alerts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,83 +6,10 @@ title: "Enable Slack alerts"

<Snippet file="alerts/alerts-introduction.mdx" />

## Setup Slack Integration
## Connect Slack

<Steps>
<Step title="Slack App">
First create a Slack app:
On the environment configuration in Elementary Cloud, click on the "Connect Slack" button.
After you approve the Elementary Cloud app, select the default Slack channel to which you'd like to send alerts, and the [suppression interval](https://docs.elementary-data.com/cloud/guides/alerts-configuration#suppression-interval).
Afterwards you will be redirected back to the environment configuration page.

<Accordion title="Create a Slack App">

## 1. Create a Slack app

Go to the [Slack page to create apps](https://api.slack.com/apps?new_app=1) and create a new app (from scratch).
Call it "[Elementary](#slack-app-display)" and connect it to the workspace of your choice.

<img
src="https://res.cloudinary.com/mintlify/image/upload/v1659304879/elementary/slack-app_zpn7jc.png"
alt="Slack app"
/>

## 2. Optional - Slack app display

To change the display of the Elementary slack app, scroll down on the Slack app basic information page to the 'Display Information' section:

<img
src="https://res.cloudinary.com/diuctyblm/image/upload/v1690367739/slack_app_customize_movkxg.png"
alt="Slack display"
/>

Here is the Elementary icon for your use (click to download):

<a
href="https://res.cloudinary.com/diuctyblm/image/upload/v1690367713/elementary_alert_dzibc7.png"
download
>
<img
src="https://res.cloudinary.com/diuctyblm/image/upload/v1690367713/elementary_alert_dzibc7.png"
alt="Elementary logo"
width="200"
/>
</a>

</Accordion>

</Step>
<Step title="Slack Token">
After the app is ready, create a Slack Token:

<Accordion title="Create Slack Token">

## 1. Create a Slack token

Go to the "OAauth & Permissions" page for your newly-created app, and add the following scopes under "Bot Token Scopes":

- `channels:join` - Join public channels in a workspace
- `channels:read` - View basic information about public channels in a workspace
- `chat:write` - Send messages as \<app\>
- `files:write` - Upload, edit, and delete files as \<app\>
- `users:read` - View people in a workspace
- `users:read.email` - View email addresses of people in a workspace
- `groups:read` - View basic information about private channels that your slack app has been added to

<img
src="https://res.cloudinary.com/diuctyblm/image/upload/v1695889115/slack-app-permissions-new_bysiso.png"
alt="Slack scopes"
/>

## 2. Install app at your Workspace

At the "OAuth & Permissions" page, press on "Install to Workspace" in order to generate Slack token:

<img
src="https://res.cloudinary.com/mintlify/image/upload/v1659304881/elementary/slack-oauth_g6p5jj.png"
alt="Slack OAuth"
/>

</Accordion>
</Step>
<Step title="Connect Slack">
On the environment configuration in Elementary Cloud, add the Slack token and configure a default channel.
</Step>
</Steps>
<img src="/pics/cloud/connect_slack.png" />
3 changes: 2 additions & 1 deletion docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@
"group": "Send Slack alerts",
"pages": [
"cloud/guides/enable-slack-alerts",
"cloud/guides/alerts-configuration"
"cloud/guides/alerts-configuration",
"cloud/guides/alert-rules"
]
},
"cloud/guides/sync-scheduling",
Expand Down
Binary file added docs/pics/cloud/alert_rules.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pics/cloud/alert_rules_drawer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pics/cloud/connect_slack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7453a27

Please sign in to comment.