Skip to content

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]

fix - data dog (#7013)

Ishaan Jaff67fe16f92931
diff --git a/litellm/integrations/datadog/datadog.py b/litellm/integrations/datadog/datadog.py
index dcc1fd6b76f..59ff4d79576 100644
--- a/litellm/integrations/datadog/datadog.py
+++ b/litellm/integrations/datadog/datadog.py
@@ -37,8 +37,6 @@ from litellm.types.integrations.datadog import *
from litellm.types.services import ServiceLoggerPayload
from litellm.types.utils import StandardLoggingPayload
-from .utils import make_json_serializable
-
DD_MAX_BATCH_SIZE = 1000 # max number of logs DD API can accept
@@ -278,7 +276,6 @@ class DataDogLogger(CustomBatchLogger):
# Build the initial payload
truncate_standard_logging_payload_content(standard_logging_object)
- make_json_serializable(standard_logging_object)
json_payload = json.dumps(standard_logging_object)
verbose_logger.debug("Datadog: Logger - Logging payload = %s", json_payload)
@@ -440,7 +437,6 @@ class DataDogLogger(CustomBatchLogger):
"metadata": clean_metadata,
}
- make_json_serializable(payload)
json_payload = json.dumps(payload)
verbose_logger.debug("Datadog: Logger - Logging payload = %s", json_payload)
diff --git a/litellm/integrations/datadog/utils.py b/litellm/integrations/datadog/utils.py
deleted file mode 100644
index 9389214f447..00000000000
--- a/litellm/integrations/datadog/utils.py
+++ /dev/null
@@ -1,13 +0,0 @@
-def make_json_serializable(payload):
- for key, value in payload.items():
- try:
- if isinstance(value, dict):
- # recursively sanitize dicts
- payload[key] = make_json_serializable(value.copy())
- elif not isinstance(value, (str, int, float, bool, type(None))):
- # everything else becomes a string
- payload[key] = str(value)
- except Exception:
- # non blocking if it can't cast to a str
- pass
- return payload