mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
fix: req changes
This commit is contained in:
parent
218383f739
commit
9b7b987b35
1 changed files with 5 additions and 7 deletions
|
|
@ -209,16 +209,14 @@ class DatadogMetricsLogger(CustomBatchLogger):
|
|||
if not self.log_queue:
|
||||
return
|
||||
|
||||
batch = self.log_queue.copy()
|
||||
payload_data: DatadogMetricsPayload = {"series": batch}
|
||||
|
||||
try:
|
||||
# We must only send the current batch, so copy and clear log queue
|
||||
batch = self.log_queue.copy()
|
||||
# Note: CustomBatchLogger clears queue in flush_queue, but we'll manually copy what we need
|
||||
|
||||
payload_data: DatadogMetricsPayload = {"series": batch}
|
||||
|
||||
await self._upload_to_datadog(payload_data)
|
||||
|
||||
except Exception as e:
|
||||
# Re-insert failed batch so next flush retries
|
||||
self.log_queue.extend(batch)
|
||||
verbose_logger.exception(
|
||||
f"Datadog Metrics: Error in async_send_batch: {str(e)}"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue