diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 0c4de59b2e..b2349a6b2b 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -2283,6 +2283,7 @@ class ProxyConfig: proxy_logging_obj.update_values( alerting=general_settings.get("alerting", None), alerting_threshold=general_settings.get("alerting_threshold", 600), + alert_types=general_settings.get("alert_types", None), redis_cache=redis_usage_cache, ) ### CONNECT TO DATABASE ### @@ -8354,7 +8355,15 @@ async def get_config(): ) _slack_env_vars[_var] = _decrypted_value - _data_to_return.append({"name": "slack", "variables": _slack_env_vars}) + _alerting_types = proxy_logging_obj.alert_types + + _data_to_return.append( + { + "name": "slack", + "variables": _slack_env_vars, + "alerting_types": _alerting_types, + } + ) _router_settings = llm_router.get_settings() return { diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.py index cd2d160ea9..78b12958bb 100644 --- a/litellm/proxy/utils.py +++ b/litellm/proxy/utils.py @@ -85,6 +85,17 @@ class ProxyLogging: alerting: Optional[List], alerting_threshold: Optional[float], redis_cache: Optional[RedisCache], + alert_types: Optional[ + List[ + Literal[ + "llm_exceptions", + "llm_too_slow", + "llm_requests_hanging", + "budget_alerts", + "db_exceptions", + ] + ] + ], ): self.alerting = alerting if alerting_threshold is not None: @@ -93,6 +104,9 @@ class ProxyLogging: if redis_cache is not None: self.internal_usage_cache.redis_cache = redis_cache + if alert_types is not None: + self.alert_types = alert_types + def _init_litellm_callbacks(self): print_verbose(f"INITIALIZING LITELLM CALLBACKS!") litellm.callbacks.append(self.max_parallel_request_limiter)