The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix custom logger
Ishaan Jaff9d2707ecfe69
diff --git a/litellm/integrations/datadog/datadog_llm_obs.py b/litellm/integrations/datadog/datadog_llm_obs.pyindex 58d16aff3e2..97226c6add9 100644--- a/litellm/integrations/datadog/datadog_llm_obs.py+++ b/litellm/integrations/datadog/datadog_llm_obs.py@@ -16,6 +16,7 @@ from typing import Any, Dict, List, Optional, Unionimport litellmfrom litellm._logging import verbose_loggerfrom litellm.integrations.custom_batch_logger import CustomBatchLogger+from litellm.integrations.datadog.datadog import DataDogLoggerfrom litellm.llms.custom_httpx.http_handler import (get_async_httpx_client,httpxSpecialProvider,@@ -24,7 +25,7 @@ from litellm.types.integrations.datadog_llm_obs import *from litellm.types.utils import StandardLoggingPayload-class DataDogLLMObsLogger(CustomBatchLogger):+class DataDogLLMObsLogger(DataDogLogger, CustomBatchLogger):def __init__(self, **kwargs):try:verbose_logger.debug("DataDogLLMObs: Initializing logger")@@ -52,7 +53,7 @@ class DataDogLLMObsLogger(CustomBatchLogger):asyncio.create_task(self.periodic_flush())self.flush_lock = asyncio.Lock()self.log_queue: List[LLMObsPayload] = []- super().__init__(**kwargs, flush_lock=self.flush_lock)+ CustomBatchLogger.__init__(self, **kwargs, flush_lock=self.flush_lock)except Exception as e:verbose_logger.exception(f"DataDogLLMObs: Error initializing - {str(e)}")raise e@@ -89,11 +90,8 @@ class DataDogLLMObsLogger(CustomBatchLogger):"data": DDIntakePayload(type="span",attributes=DDSpanAttributes(- ml_app="litellm",- tags=[- "service:litellm",- f"env:{os.getenv('DD_ENV', 'production')}",- ],+ ml_app=self._get_datadog_service(),+ tags=[self._get_datadog_tags()],spans=self.log_queue,),),