litellm/tests/test_litellm/integrations/datadog
devin-ai-integration[bot] 09b694894d
fix(datadog_llm_obs): keep tool call and result structure under redaction and emit tool output tokens (#40666)
* fix(datadog_llm_obs): keep tool call and result structure under redaction and emit tool output tokens

Under datadog_llm_observability_params.turn_off_message_logging the span kept only one role plus "redacted-by-litellm" per message, so Datadog showed Tool Call 0, Tool Result 0 and no tool output token data. The shared CustomLogger hook collapsed the messages before the callback ran, and the Datadog redaction then dropped tool_calls and tool_results.

The Datadog callback now opts out of the shared message collapse (redacts_messages_itself) and redacts its own normalized messages, keeping roles, tool names, ids and types while replacing content, arguments and results. Tool result tokens are counted with litellm.token_counter before redaction and shipped as the tool_output_tokens metric. Other callbacks keep the inherited behavior.

Resolves LIT-7545

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(datadog_llm_obs): drop explanatory docstrings from the redaction change

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* chore(ui): regenerate schema.d.ts for the classifier descriptions changed in #40655

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-11 13:12:14 -07:00
..
test_datadog_cost_management.py test(datadog): restore an empty DD_API_KEY instead of unsetting it (#37832) 2026-08-21 20:39:07 -07:00
test_datadog_llm_obs.py fix(datadog_llm_obs): keep tool call and result structure under redaction and emit tool output tokens (#40666) 2026-09-11 13:12:14 -07: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_logger_batching.py fix(azure_sentinel): split batches under the 1MB ingestion cap (#39880) 2026-09-05 17:15:36 -07:00
test_datadog_metrics.py test(datadog): restore an empty DD_API_KEY instead of unsetting it (#37832) 2026-08-21 20:39:07 -07:00
test_datadog_tags_regression.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_datadog_team_handler.py fix(datadog): read team callback dd_* params from kwargs instead of blocked dynamic params (#35115) (#35687) 2026-08-03 16:19:56 -07:00