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

removing other actions from docs and schema #66

Merged
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
17 changes: 5 additions & 12 deletions whylabs_toolkit/monitor/manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,10 @@ monitor_setup.config = StddevConfig(
```

## Add alert actions
Now that you have a logic to which you will generate alerts, you need to define **how** you wish to be notified:
Now that you have a logic to which you will generate alerts, you need to define the Global Actions that will be triggered once this monitor detects an anomaly. In order to create an action, you can refer to [our docs](https://docs.whylabs.ai/docs/whylabs-notifications/#overview) and click through the UI or do it programmatically. Once you have an action ID, you can use the `whylabs-toolkit` to append that action to your monitor by using the following assignment:

```python
monitor_setup.actions = [
EmailRecipient(id="my-email", destination="[email protected]"),
SlackWebhook(id="my-slack-wh", destination="https://slack.web.hook.com")
]
monitor_setup.actions = [GlobalAction(target="my_slack_webhook")] # you can define a list of GlobalAction's to be triggered
```

## Define a schedule
Expand Down Expand Up @@ -153,13 +150,9 @@ Which will print the following JSON object to the console:
},
"actions": [
{
"type": "email",
"target": "[email protected]"
"type": "global",
"target": "my_slack_webhook"
},
{
"type": "slack",
"target": "https://slack.web.hook.com"
}
]
}
]
Expand Down Expand Up @@ -260,7 +253,7 @@ monitor_setup.set_target_columns(columns=["group: discrete"])
monitor_setup.exclude_target_columns(columns=["group:output"])

# Instead of setting a new action, extend the existing ones
monitor_setup.actions.extend([EmailRecipient(id="existing-email-id")])
monitor_setup.actions.extend([GlobalAction(target="my_pagerduty_id")])

## Save your modifications
monitor_setup.apply()
Expand Down
80 changes: 0 additions & 80 deletions whylabs_toolkit/monitor/schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2230,86 +2230,6 @@
],
"additionalProperties": false
},
"SendEmail": {
"title": "SendEmail",
"description": "Action to send an email.",
"type": "object",
"properties": {
"type": {
"title": "Type",
"enum": [
"email"
],
"type": "string"
},
"target": {
"title": "Target",
"description": "Destination email",
"maxLength": 1000,
"format": "email",
"type": "string"
}
},
"required": [
"type",
"target"
],
"additionalProperties": false
},
"SlackWebhook": {
"title": "SlackWebhook",
"description": "Action to send a Slack webhook.",
"type": "object",
"properties": {
"type": {
"title": "Type",
"enum": [
"slack"
],
"type": "string"
},
"target": {
"title": "Target",
"description": "The Slack webhook",
"minLength": 1,
"maxLength": 2083,
"format": "uri",
"type": "string"
}
},
"required": [
"type",
"target"
],
"additionalProperties": false
},
"RawWebhook": {
"title": "RawWebhook",
"description": "Action to send a Slack webhook.",
"type": "object",
"properties": {
"type": {
"title": "Type",
"enum": [
"raw"
],
"type": "string"
},
"target": {
"title": "Target",
"description": "Sending raw unformatted message in JSON format to a webhook",
"minLength": 1,
"maxLength": 2083,
"format": "uri",
"type": "string"
}
},
"required": [
"type",
"target"
],
"additionalProperties": false
},
"Monitor": {
"title": "Monitor",
"description": "Customer specified monitor configs.",
Expand Down