From a7140864618a24b16ff5c943ec9d17c8bc819be9 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 14 May 2024 14:43:21 -0700 Subject: [PATCH] docs - use discord alerting --- docs/my-website/docs/proxy/alerting.md | 39 +++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/docs/my-website/docs/proxy/alerting.md b/docs/my-website/docs/proxy/alerting.md index 31c1a779054..230a3a22e91 100644 --- a/docs/my-website/docs/proxy/alerting.md +++ b/docs/my-website/docs/proxy/alerting.md @@ -22,6 +22,7 @@ Set up a slack alert channel to receive alerts from proxy. Get a slack webhook url from https://api.slack.com/messaging/webhooks +You can also use Discord Webhooks, see [here](#using-discord-webhooks) ### Step 2: Update config.yaml @@ -58,4 +59,40 @@ Make a GET request to `/health/services`, expect to see a test slack alert in yo ```shell curl -X GET 'http://localhost:4000/health/services?service=slack' \ -H 'Authorization: Bearer sk-1234' -``` \ No newline at end of file +``` + + +## Extras + +### Using Discord Webhooks + +Discord provides a slack compatible webhook url that you can use for alerting + +##### Quick Start + +1. Get a webhook url for your discord channel + +2. Append `/slack` to your discord webhook - it should look like + +``` +"https://discord.com/api/webhooks/1240030362193760286/cTLWt5ATn1gKmcy_982rl5xmYHsrM1IWJdmCL1AyOmU9JdQXazrp8L1_PYgUtgxj8x4f/slack" +``` + +3. Add it to your litellm config + +```yaml +model_list: + model_name: "azure-model" + litellm_params: + model: "azure/gpt-35-turbo" + api_key: "my-bad-key" # 👈 bad key + +general_settings: + alerting: ["slack"] + alerting_threshold: 300 # sends alerts if requests hang for 5min+ and responses take 5min+ + +environment_variables: + SLACK_WEBHOOK_URL: "https://discord.com/api/webhooks/1240030362193760286/cTLWt5ATn1gKmcy_982rl5xmYHsrM1IWJdmCL1AyOmU9JdQXazrp8L1_PYgUtgxj8x4f/slack" +``` + +That's it ! You're ready to go !