Considerably raise DEFAULT_MAX_VALUE_LENGTH#4632
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4632 +/- ##
=======================================
Coverage 80.74% 80.74%
=======================================
Files 156 156
Lines 16630 16630
Branches 2830 2830
=======================================
Hits 13428 13428
Misses 2312 2312
Partials 890 890
|
|
|
||
| # up top to prevent circular import due to integration import | ||
| DEFAULT_MAX_VALUE_LENGTH = 1024 | ||
| DEFAULT_MAX_VALUE_LENGTH = 100_000 |
There was a problem hiding this comment.
Why not use sys.maxsize here? Then, we definitely should never need to bump this limit again.
There was a problem hiding this comment.
In any case, let's add a code comment to document how we picked the value we end up going with
There was a problem hiding this comment.
Talked about this offline -- and added a comment
| (event,) = events | ||
|
|
||
| assert len(json.dumps(event)) < 10000 | ||
| assert len(json.dumps(event)) < DEFAULT_MAX_VALUE_LENGTH * 10 |
There was a problem hiding this comment.
Bug: String Truncation Test Assertion Too Weak
The assertion in test_databag_string_stripping is too weak, defeating the test's purpose. This test is designed to verify that large strings are truncated to keep serialized event sizes manageable. However, the current assertion len(json.dumps(event)) < DEFAULT_MAX_VALUE_LENGTH * 10 allows the serialized event to be as large as the input string (1,000,000 bytes, given DEFAULT_MAX_VALUE_LENGTH = 100_000). This fails to ensure that truncation is actually occurring and keeping the event size manageable. The assertion should be tightened to effectively test string stripping, similar to the original < 10000 bound.
Locations (1)
Remove the default string limit applied when serializing envelopes. The `max_value_length` parameter now accepts `None`, which disables string truncation. The default value is changed to `None`. The change follows on from raising the limit in #4632. Replaces `DEFAULT_MAX_VALUE_LENGTH` with the value 1024 in tests, which was the original limit. Closes #4988
AI prompts/messages are potentially huge.
DEFAULT_MAX_VALUE_LENGTH(responsible for string trimming) from 1024 to 100 000This does not seem to affect issue grouping, see e.g. https://sentry-sdks.sentry.io/issues/6774464781/events/latest/?project=4506716433416192&query=is%3Aunresolved&referrer=latest-event