Merge branch 'main' into litellm_test_slack_alerts

This commit is contained in:
Ishaan Jaff 2024-03-02 16:49:12 -08:00 committed by GitHub
commit 9fea8e7152
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6513,9 +6513,11 @@ async def health_services_endpoint(
},
)
if "slack" in general_settings.get("alerting", []):
test_message = f"""\n🚨 `ProjectedLimitExceededError` 💸\n\n`Key Alias:` my-secret-project \n`Expected Day of Error`: 28th March \n`Current Spend`: 100 \n`Projected Spend at end of month`: 1000 \n"""
await proxy_logging_obj.alerting_handler(
message="This is a test", level="Low"
message=test_message, level="Low"
)
else:
raise HTTPException(
@ -6539,8 +6541,6 @@ async def health_services_endpoint(
type="auth_error",
param=getattr(e, "param", "None"),
code=status.HTTP_401_UNAUTHORIZED,
)
@router.get("/health", tags=["health"], dependencies=[Depends(user_api_key_auth)])
async def health_endpoint(