mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
feat add cron job for sending stats from prometheus
This commit is contained in:
parent
017ba7a0fe
commit
aef13a37f4
1 changed files with 13 additions and 0 deletions
|
@ -2795,6 +2795,19 @@ async def startup_event():
|
|||
day=1,
|
||||
)
|
||||
|
||||
# Beta Feature - only used when prometheus api is in .env
|
||||
if os.getenv("PROMETHEUS_URL"):
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
scheduler.add_job(
|
||||
proxy_logging_obj.slack_alerting_instance.send_fallback_stats_from_prometheus,
|
||||
"cron",
|
||||
hour=9,
|
||||
minute=0,
|
||||
timezone=ZoneInfo("America/Los_Angeles"), # Pacific Time
|
||||
)
|
||||
await proxy_logging_obj.slack_alerting_instance.send_fallback_stats_from_prometheus()
|
||||
|
||||
scheduler.start()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue