Skip to content

Fix Slack alerting not working if using a DB #10370

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

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

hypermoose
Copy link

@hypermoose hypermoose commented Apr 27, 2025

Title

Fix Slack alerting not working if using a DB.

Relevant issues

Fixes #10368

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on (make test-unit)[https://docs.litellm.ai/docs/extras/contributing_code]
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🐛 Bug Fix

Changes

Add starting the periodic tasks in updateValues if alerting_args is updated but adds a flag to make sure dups arent started.

Screenshot 2025-05-01 at 9 55 15 PM

Copy link

vercel bot commented Apr 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 6, 2025 5:25pm

@CLAassistant
Copy link

CLAassistant commented Apr 27, 2025

CLA assistant check
All committers have signed the CLA.

@krrishdholakia
Copy link
Contributor

Hi @hypermoose i'm able to see slack alerting working with a connected db,

What's the error you're getting?

@hypermoose
Copy link
Author

hypermoose commented Apr 28, 2025

@krrishdholakia there is no error but the periodic 5 second batch send is never initialized so until 512 alerts queue up a send never happens. I can reproduce this easily by deploying a fresh instance of the release on railway setting the required environment variables including STORE_DB_IN_MODEL and SLACK_WEBHOOK_URL and then send a test alert via the UI. It never sends. I made mods to print out what was happening and reploy and found that alerting was being set to true in the init not in update_values so the periodic timer was never started.

@hypermoose
Copy link
Author

Hi @hypermoose i'm able to see slack alerting working with a connected db,

What's the error you're getting?

Is there something else I can do to move this PR foward?

@krrishdholakia
Copy link
Contributor

Hey @hypermoose yep - just add the corresponding unit tests inside tests/litellm, and we should be good to merge

@hypermoose
Copy link
Author

Hey @hypermoose yep - just add the corresponding unit tests inside tests/litellm, and we should be good to merge

I added the first unit test for SlackReporting based on other examples in the integration folder.

@hypermoose hypermoose requested a review from krrishdholakia May 2, 2025 16:10
@hypermoose
Copy link
Author

@krrishdholakia It looks like the unit tests are real close to the 5 min limit set and get cancelled based on merge size or other factors. Can the 5 minutes be increased?

@hypermoose
Copy link
Author

@krrishdholakia It looks like the unit tests are real close to the 5 min limit set and get cancelled based on merge size or other factors. Can the 5 minutes be increased?

Found it and increased. I hope this change finally allow my fix to get merged.

@hypermoose
Copy link
Author

@krrishdholakia can I merge this now?

@hypermoose
Copy link
Author

@krrishdholakia can I merge this now?

@ishaan-jaff Could you help me get this merged? I've been dealing with merge conflicts for days and I think I did everything I was asked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Slack reporting's periodic batch send is never initialized if using a DB.
3 participants