Skip to content

Commit

Permalink
removing other actions from docs and schema
Browse files Browse the repository at this point in the history
  • Loading branch information
murilommen committed Jul 1, 2024
1 parent 1b9c2d7 commit d8ca034
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 92 deletions.
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="some_mail@example.com"),
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": "some_mail@example.com"
"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

0 comments on commit d8ca034

Please sign in to comment.