ui - show all alert types when getting all callbacks

This commit is contained in:
Ishaan Jaff 2024-04-18 20:08:13 -07:00
parent 48e53984c0
commit 554c83fdaf
2 changed files with 13 additions and 1 deletions

View file

@ -8379,12 +8379,13 @@ async def get_config():
_slack_env_vars[_var] = _decrypted_value _slack_env_vars[_var] = _decrypted_value
_alerting_types = proxy_logging_obj.alert_types _alerting_types = proxy_logging_obj.alert_types
_all_alert_types = proxy_logging_obj._all_possible_alert_types()
_data_to_return.append( _data_to_return.append(
{ {
"name": "slack", "name": "slack",
"variables": _slack_env_vars, "variables": _slack_env_vars,
"alerting_types": _alerting_types, "alerting_types": _alerting_types,
"all_alert_types": _all_alert_types,
} }
) )

View file

@ -81,6 +81,17 @@ class ProxyLogging:
"db_exceptions", "db_exceptions",
] ]
def _all_possible_alert_types(self):
# used by the UI to show all supported alert types
# Note: This is not the alerts the user has configured, instead it's all possible alert types a user can select
return [
"llm_exceptions",
"llm_too_slow",
"llm_requests_hanging",
"budget_alerts",
"db_exceptions",
]
def update_values( def update_values(
self, self,
alerting: Optional[List], alerting: Optional[List],