fix - data dog (#7013)

This commit is contained in:
Ishaan Jaff
2024-12-03 16:43:23 -08:00
committed by GitHub
parent 7d26c1ab6b
commit 67fe16f929
2 changed files with 0 additions and 17 deletions
-4
View File
@@ -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)
-13
View File
@@ -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