forked from phoenix/litellm-mirror
fix - log api_base in errors
This commit is contained in:
parent
06804bc70a
commit
ee2a2ce559
3 changed files with 7 additions and 0 deletions
|
@ -914,6 +914,7 @@ class LiteLLM_SpendLogs(LiteLLMBase):
|
|||
|
||||
class LiteLLM_ErrorLogs(LiteLLMBase):
|
||||
request_id: Optional[str] = str(uuid.uuid4())
|
||||
api_base: Optional[str] = ""
|
||||
model_name: Optional[str] = ""
|
||||
model_id: Optional[str] = ""
|
||||
request_kwargs: Optional[Json] = {}
|
||||
|
|
|
@ -1239,6 +1239,9 @@ async def _PROXY_failure_handler(
|
|||
_litellm_params = kwargs.get("litellm_params", {}) or {}
|
||||
_metadata = _litellm_params.get("metadata", {}) or {}
|
||||
_model_id = _metadata.get("model_info", {}).get("id", None)
|
||||
|
||||
api_base = litellm.get_api_base(model=_model, optional_params=_litellm_params)
|
||||
|
||||
verbose_proxy_logger.debug(
|
||||
"\nexception_type",
|
||||
_exception_type,
|
||||
|
@ -1252,8 +1255,10 @@ async def _PROXY_failure_handler(
|
|||
traceback,
|
||||
)
|
||||
error_log = LiteLLM_ErrorLogs(
|
||||
request_id=str(uuid.uuid4()),
|
||||
model_name=_model,
|
||||
model_id=_model_id,
|
||||
api_base=api_base,
|
||||
exception_type=_exception_type,
|
||||
status_code=_status_code,
|
||||
exception_string=str(_exception),
|
||||
|
|
|
@ -186,6 +186,7 @@ model LiteLLM_SpendLogs {
|
|||
// View spend, model, api_key per request
|
||||
model LiteLLM_ErrorLogs {
|
||||
request_id String @id @default(uuid())
|
||||
api_base String @default("")
|
||||
model_name String @default("") // public model_name / model_group
|
||||
model_id String @default("") // ID of model in ProxyModelTable
|
||||
request_kwargs Json @default("{}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue