litellm/tests/test_litellm/integrations/datadog
Yucheng Zhu c80ef283a6 fix(datadog): split LLM Obs span batches proactively under intake limits
Closes LIT-4358.

DataDogLLMObsLogger.async_send_batch posted the entire log_queue to
/api/intake/llm-obs/v1/trace/spans as one payload with no byte or
event-count cap and no failure handling. Worse, the base
CustomBatchLogger.flush_queue cleared the queue even when the send
failed, so any failed flush window silently dropped every span.

Port the _send_with_413_split strategy from the log-intake logger:

- Proactively split batches exceeding DD_MAX_BATCH_SIZE (1000) events
  or DD_MAX_PAYLOAD_SIZE_BYTES (4 MB serialised) before POSTing
- On a 413 response, halve and retry; drop single un-splittable spans
- On transient errors, re-queue undelivered spans for the next flush
- Override flush_queue so the base class cannot wipe re-queued spans
- Run the proactive size check inside the send loop's try so a
  serialization failure re-queues only undelivered chunks

Adds pytest cases covering proactive count and byte splits, 413
halving, single-span drop, transient and HTTP 500 re-queue,
flush_queue preservation, and the no-duplicate guarantee on size
check failure.
2026-07-11 12:29:37 -07:00
..
test_datadog_cost_management.py fix(datadog): drain cost-management queue + opt-in FinOps tag allowlist (#28487) 2026-05-28 21:04:04 +02:00
test_datadog_llm_obs_agent.py feat(datadog): add agent support for LLM Observability (#19574) 2026-01-22 19:49:22 -08:00
test_datadog_llm_observability.py fix(datadog): split LLM Obs span batches proactively under intake limits 2026-07-11 12:29:37 -07:00
test_datadog_logger_batching.py fix(datadog): split log batches proactively under intake payload limits (#32860) 2026-07-10 20:54:42 -07:00
test_datadog_metrics.py Litellm oss staging 250526 (#28770) 2026-05-26 11:57:39 -07:00
test_datadog_tags_regression.py Ishaan - March 18th changes (#24056) 2026-03-19 10:20:35 -07:00
test_datadog_team_handler.py chore(oss): litellm oss staging 120626 (#30292) 2026-06-12 09:49:25 -07:00