(docs) alerting slack budgets

This commit is contained in:
ishaan-jaff 2024-03-02 17:55:49 -08:00
parent aa565dc990
commit fa2c6fdebb
7 changed files with 49 additions and 7 deletions

View file

@ -33,12 +33,16 @@ general_settings:
alerting: ["slack"]
alerting_threshold: 300 # sends alerts if requests hang for 5min+ and responses take 5min+
environment_variables:
SLACK_WEBHOOK_URL: "https://hooks.slack.com/services/<>/<>/<>"
```
Set `SLACK_WEBHOOK_URL` in your proxy env
```shell
SLACK_WEBHOOK_URL: "https://hooks.slack.com/services/<>/<>/<>"
```
### Step 3: Start proxy
```bash
$ litellm /path/to/config.yaml
$ litellm --config /path/to/config.yaml
```

View file

@ -4,17 +4,54 @@ import Image from '@theme/IdealImage';
**Alerts when a project will exceed its planned limit**
<Image img={require('../../img/budget_alert.png')} />
<Image img={require('../../img/budget_alerts.png')} />
## Quick Start
### 1. Setup Slack Alerting on your Proxy Config.yaml
**Update proxy config.yaml with slack alerting**
Add `general_settings:alerting`
```yaml
model_list:
model_name: "azure-model"
litellm_params:
model: "azure/gpt-35-turbo"
general_settings:
alerting: ["slack"]
```
Get a slack webhook url from https://api.slack.com/messaging/webhooks
Set `SLACK_WEBHOOK_URL` in your proxy env
```shell
SLACK_WEBHOOK_URL: "https://hooks.slack.com/services/<>/<>/<>"
```
Start proxy
```bash
$ litellm --config /path/to/config.yaml
```
### 2. Create API Key on Proxy Admin UI
The Admin UI is found on `your-litellm-proxy-endpoint/ui`, example `http://localhost:4000/ui/`
### 1. Create API Key on Admin UI
- Set a key name
- Set a Soft Budget on when to get alerted
### 2. Test Alerting
<Image img={require('../../img/create_key.png')} />
### 3. Check Slack
### 3. Test Slack Alerting on Admin UI
After creating a key on the Admin UI, click on "Test Slack Alert" to send a test alert to your Slack channel
<Image img={require('../../img/test_alert.png')} />
### 4. Check Slack
When the test alert works, you should expect to see this on your alerts slack channel
<Image img={require('../../img/budget_alerts.png')} />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

View file

@ -40,6 +40,7 @@ const sidebars = {
"proxy/virtual_keys",
"proxy/users",
"proxy/ui",
"proxy/budget_alerts",
"proxy/model_management",
"proxy/health",
"proxy/debugging",