-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(llmobs): truncate LLMObs span events that are >1MB in size (#10148)
Events that are >1MB are not supported by the event platform, and will be truncated automatically in ways that make them no longer processable by the LLMObs event processor. This change introduces truncation for span events that exceed that size limitation. Truncation is performed by dropping the input and output fields.
- Loading branch information
Showing
7 changed files
with
177 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
releasenotes/notes/truncate-oversized-llmobs-span-events-6e8a54015739ba82.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
features: | ||
- | | ||
LLM Observability: Span events that exceed the event platform event size limit (1 MB) will now have their inputs | ||
and outputs dropped. The `dropped_io:1` tag will be added to these span events. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import json | ||
|
||
from ddtrace.llmobs._constants import EVP_EVENT_SIZE_LIMIT | ||
from ddtrace.llmobs._writer import _truncate_span_event | ||
from tests.llmobs._utils import _oversized_llm_event | ||
from tests.llmobs._utils import _oversized_retrieval_event | ||
from tests.llmobs._utils import _oversized_workflow_event | ||
|
||
|
||
def test_truncates_oversized_span_values(): | ||
assert len(json.dumps(_truncate_span_event(_oversized_workflow_event()))) < EVP_EVENT_SIZE_LIMIT | ||
|
||
|
||
def test_truncates_oversized_span_messages(): | ||
assert len(json.dumps(_truncate_span_event(_oversized_llm_event()))) < EVP_EVENT_SIZE_LIMIT | ||
|
||
|
||
def test_truncates_oversized_span_documents(): | ||
assert len(json.dumps(_truncate_span_event(_oversized_retrieval_event()))) < EVP_EVENT_SIZE_LIMIT |