feat(eap): Trim spans with new trimming processor#5616
Conversation
71dd15b to
b7f3288
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| return Ok(()); | ||
| } | ||
|
|
||
| // This counts the lengths of all attribute keys regardless of whether |
There was a problem hiding this comment.
Object trimming drops last remarked key via split_off
Medium Severity
The process_object split logic sets i = key.as_str() before the match and never advances it afterward, so split_off(&i) removes the last key that received WithRemark. In contrast, process_array and process_attributes both increment i after the match, correctly preserving remarked entries. When all remaining keys fit within removed_key_byte_budget, the final remarked key is silently dropped. This code was previously gated behind #[allow(unused)] and is now activated for span processing.
Additional Locations (1)
This adds the trimming configuration implemented in Relay in getsentry/relay#5616 to the project config. The implementation in `sentry` is trivial; the actual values are going to be provided in `getsentry` in a subsequent PR.
This adds the trimming configuration implemented in Relay in getsentry/relay#5616 to the project config. The implementation in `sentry` is trivial; the actual values are going to be provided in `getsentry` in a subsequent PR. Closes INGEST-747. --------- Co-authored-by: Simon Hellmayr <shellmayr@users.noreply.github.com> Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>


This puts the new trimming processor into practice by enabling it for spans. It also introduces some necessary configuration:
max_removed_attribute_key_bytes(default 10KiB) that controls up to which limit Relay will store invalid/removed attribute keys.trimmingsection in the project config which (for now) allows configuring the maximum bytes size above which spans should be trimmed. If this is not set, spans will not be trimmed.ref: INGEST-732.