forked from phoenix/litellm-mirror
log startTime and EndTime for exceptions
This commit is contained in:
parent
3aad034a8b
commit
4b8fda4ac4
3 changed files with 6 additions and 0 deletions
|
@ -921,6 +921,8 @@ class LiteLLM_ErrorLogs(LiteLLMBase):
|
||||||
exception_type: Optional[str] = ""
|
exception_type: Optional[str] = ""
|
||||||
status_code: Optional[str] = ""
|
status_code: Optional[str] = ""
|
||||||
exception_string: Optional[str] = ""
|
exception_string: Optional[str] = ""
|
||||||
|
startTime: Union[str, datetime, None]
|
||||||
|
endTime: Union[str, datetime, None]
|
||||||
|
|
||||||
|
|
||||||
class LiteLLM_SpendLogs_ResponseObject(LiteLLMBase):
|
class LiteLLM_SpendLogs_ResponseObject(LiteLLMBase):
|
||||||
|
|
|
@ -1263,6 +1263,8 @@ async def _PROXY_failure_handler(
|
||||||
exception_type=_exception_type,
|
exception_type=_exception_type,
|
||||||
status_code=_status_code,
|
status_code=_status_code,
|
||||||
exception_string=_exception_string,
|
exception_string=_exception_string,
|
||||||
|
startTime=kwargs.get("start_time"),
|
||||||
|
endTime=kwargs.get("end_time"),
|
||||||
)
|
)
|
||||||
|
|
||||||
# helper function to convert to dict on pydantic v2 & v1
|
# helper function to convert to dict on pydantic v2 & v1
|
||||||
|
|
|
@ -186,6 +186,8 @@ model LiteLLM_SpendLogs {
|
||||||
// View spend, model, api_key per request
|
// View spend, model, api_key per request
|
||||||
model LiteLLM_ErrorLogs {
|
model LiteLLM_ErrorLogs {
|
||||||
request_id String @id @default(uuid())
|
request_id String @id @default(uuid())
|
||||||
|
startTime DateTime // Assuming start_time is a DateTime field
|
||||||
|
endTime DateTime // Assuming end_time is a DateTime field
|
||||||
api_base String @default("")
|
api_base String @default("")
|
||||||
model_group String @default("") // public model_name / model_group
|
model_group String @default("") // public model_name / model_group
|
||||||
model_id String @default("") // ID of model in ProxyModelTable
|
model_id String @default("") // ID of model in ProxyModelTable
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue