mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
Merge pull request #3151 from BerriAI/litellm_allow_set_get_alerts
[UI] View all alert types
This commit is contained in:
commit
0ed5cfc9de
3 changed files with 15 additions and 3 deletions
|
|
@ -8379,12 +8379,13 @@ async def get_config():
|
|||
_slack_env_vars[_var] = _decrypted_value
|
||||
|
||||
_alerting_types = proxy_logging_obj.alert_types
|
||||
|
||||
_all_alert_types = proxy_logging_obj._all_possible_alert_types()
|
||||
_data_to_return.append(
|
||||
{
|
||||
"name": "slack",
|
||||
"variables": _slack_env_vars,
|
||||
"alerting_types": _alerting_types,
|
||||
"all_alert_types": _all_alert_types,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -81,6 +81,17 @@ class ProxyLogging:
|
|||
"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(
|
||||
self,
|
||||
alerting: Optional[List],
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ const Settings: React.FC<SettingsPageProps> = ({
|
|||
</li>
|
||||
))}
|
||||
</ul>
|
||||
{callback.alerting_types && (
|
||||
{callback.all_alert_types && (
|
||||
<div>
|
||||
<Text className="mt-2">Alerting Types</Text>
|
||||
<Select
|
||||
|
|
@ -193,7 +193,7 @@ const Settings: React.FC<SettingsPageProps> = ({
|
|||
onChange={handleChange}
|
||||
defaultValue={callback.alerting_types}
|
||||
>
|
||||
{callback.alerting_types.map((type: string) => (
|
||||
{callback.all_alert_types.map((type: string) => (
|
||||
<Select.Option key={type} value={type} label={type}>
|
||||
{type}
|
||||
</Select.Option>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue