mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
(fix) alerting - show timestamps in alert
This commit is contained in:
parent
8f4e256531
commit
6c13776701
2 changed files with 9 additions and 2 deletions
|
@ -152,6 +152,7 @@ class ProxyLogging:
|
|||
request_info = f"\nRequest Model: {model}\nMessages: {messages}"
|
||||
else:
|
||||
request_info = ""
|
||||
|
||||
if type == "hanging_request":
|
||||
# Simulate a long-running operation that could take more than 5 minutes
|
||||
await asyncio.sleep(
|
||||
|
@ -193,7 +194,13 @@ class ProxyLogging:
|
|||
level: str - Low|Medium|High - if calls might fail (Medium) or are failing (High); Currently, no alerts would be 'Low'.
|
||||
message: str - what is the alert about
|
||||
"""
|
||||
formatted_message = f"Level: {level}\n\nMessage: {message}"
|
||||
from datetime import datetime
|
||||
|
||||
# Get the current timestamp
|
||||
current_time = datetime.now().strftime("%H:%M:%S")
|
||||
formatted_message = (
|
||||
f"Level: {level}\nTimestamp: {current_time}\n\nMessage: {message}"
|
||||
)
|
||||
if self.alerting is None:
|
||||
return
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue