mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
(FIX) improve slack alerting messages
This commit is contained in:
parent
b993c62144
commit
9aae60f162
2 changed files with 4 additions and 3 deletions
|
@ -162,6 +162,7 @@ class ProxyLogging:
|
|||
request_data is not None
|
||||
and request_data.get("litellm_status", "") != "success"
|
||||
):
|
||||
# only alert hanging responses if they have not been marked as success
|
||||
alerting_message = (
|
||||
f"Requests are hanging - {self.alerting_threshold}s+ request time"
|
||||
)
|
||||
|
@ -173,9 +174,7 @@ class ProxyLogging:
|
|||
elif (
|
||||
type == "slow_response" and start_time is not None and end_time is not None
|
||||
):
|
||||
slow_message = (
|
||||
f"Responses are slow - {round(end_time-start_time,2)}s response time"
|
||||
)
|
||||
slow_message = f"Responses are slow - {round(end_time-start_time,2)}s response time > Alerting threshold: {self.alerting_threshold}s"
|
||||
if end_time - start_time > self.alerting_threshold:
|
||||
await self.alerting_handler(
|
||||
message=slow_message + request_info,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue