mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
fix - show api base on hanging requests
This commit is contained in:
parent
8c830e031d
commit
f04604910b
1 changed files with 10 additions and 0 deletions
|
@ -327,6 +327,16 @@ class ProxyLogging:
|
||||||
_api_base = ""
|
_api_base = ""
|
||||||
|
|
||||||
request_info += f"\nAPI Base: {_api_base}"
|
request_info += f"\nAPI Base: {_api_base}"
|
||||||
|
elif request_data.get("metadata", None) is not None and isinstance(
|
||||||
|
request_data["metadata"], dict
|
||||||
|
):
|
||||||
|
# In hanging requests sometime it has not made it to the point where the deployment has been set
|
||||||
|
# in that case we fallback to the api base set in the request metadata
|
||||||
|
_metadata = request_data["metadata"]
|
||||||
|
_api_base = _metadata.get("api_base", "")
|
||||||
|
if _api_base is None:
|
||||||
|
_api_base = ""
|
||||||
|
request_info += f"\nAPI Base: {_api_base}"
|
||||||
# only alert hanging responses if they have not been marked as success
|
# only alert hanging responses if they have not been marked as success
|
||||||
alerting_message = (
|
alerting_message = (
|
||||||
f"`Requests are hanging - {self.alerting_threshold}s+ request time`"
|
f"`Requests are hanging - {self.alerting_threshold}s+ request time`"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue